import itertools
def resolve():
    n = int(input())
    d = tuple(map(int,input().split()))
    ans = 0
    for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
    print(ans)
resolve() import itertools itertools def resolve():
    n = int(input())
    d = tuple(map(int,input().split()))
    ans = 0
    for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
    print(ans) resolve n = int(input()) n int(input()) int input() input d = tuple(map(int,input().split())) d tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split ans = 0 ans 0 for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
     a itertools.combinations(d,2) itertools.combinations itertools combinations d 2 ans += a[0]*a[1] ans a[0]*a[1] a[0] a 0 a[1] a 1 print(ans) print ans resolve() resolve def resolve():
    n = int(input())
    d = tuple(map(int,input().split()))
    ans = 0
    for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
    print(ans) def resolve():
    n = int(input())
    d = tuple(map(int,input().split()))
    ans = 0
    for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
    print(ans) resolve
import itertools
def resolve():
    n = int(input())
    d = tuple(map(int,input().split()))
    ans = 0
    for a in itertools.combinations(d,2):
        ans += a[0]*a[1]
    print(ans)
resolve()