from itertools import combinations
input()
d = list(map(int,input().split()))
comb = combinations(d,2)
dsum = 0
for a,b in comb:
    dsum += a*b

print(dsum) from itertools import combinations 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 comb = combinations(d,2) comb combinations(d,2) combinations d 2 dsum = 0 dsum 0 for a,b in comb:
    dsum += a*b a b comb dsum += a*b dsum a*b a b print(dsum) print dsum comb = combinations(d,2) combinations(d,2) comb d = list(map(int,input().split())) list(map(int,input().split())) d dsum = 0 0 dsum dsum += a*b a*b dsum
from itertools import combinations
input()
d = list(map(int,input().split()))
comb = combinations(d,2)
dsum = 0
for a,b in comb:
    dsum += a*b

print(dsum)