import itertools
n = int(input())
d = list(map(int, input().split()))
M = []
ans = 0

for v in itertools.combinations(d, 2):
    M.append(list(v))

for m in M:
    ans += m[0]*m[1]
print(ans) import itertools itertools n = int(input()) n int(input()) int input() input d = list(map(int, input().split())) d list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split M = [] M [] ans = 0 ans 0 for v in itertools.combinations(d, 2):
    M.append(list(v)) v itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 M.append(list(v)) M.append M append list(v) list v for m in M:
    ans += m[0]*m[1] m M ans += m[0]*m[1] ans m[0]*m[1] m[0] m 0 m[1] m 1 print(ans) print ans d = list(map(int, input().split())) list(map(int, input().split())) d M = [] [] M ans += m[0]*m[1] m[0]*m[1] ans ans = 0 0 ans n = int(input()) int(input()) n
import itertools
n = int(input())
d = list(map(int, input().split()))
M = []
ans = 0

for v in itertools.combinations(d, 2):
    M.append(list(v))

for m in M:
    ans += m[0]*m[1]
print(ans)