n=int(input())
d = list(map(int,input().split()))
import itertools
p = itertools.combinations(d, 2)
s=0
for v in p:
    s+=v[0]*v[1]
print(s) 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 import itertools itertools p = itertools.combinations(d, 2) p itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 s=0 s 0 for v in p:
    s+=v[0]*v[1] v p s+=v[0]*v[1] s v[0]*v[1] v[0] v 0 v[1] v 1 print(s) print s n=int(input()) int(input()) n p = itertools.combinations(d, 2) itertools.combinations(d, 2) p s=0 0 s d = list(map(int,input().split())) list(map(int,input().split())) d s+=v[0]*v[1] v[0]*v[1] s
n=int(input())
d = list(map(int,input().split()))
import itertools
p = itertools.combinations(d, 2)
s=0
for v in p:
    s+=v[0]*v[1]
print(s)