import itertools

N = int(input())
d = list(map(int, input().split()))

combi = list(itertools.combinations(range(N), 2))
sumD = 0
for x in combi:
    sumD += d[x[0]] * d[x[1]]

print(sumD) 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 combi = list(itertools.combinations(range(N), 2)) combi list(itertools.combinations(range(N), 2)) list itertools.combinations(range(N), 2) itertools.combinations itertools combinations range(N) range N 2 sumD = 0 sumD 0 for x in combi:
    sumD += d[x[0]] * d[x[1]] x combi sumD += d[x[0]] * d[x[1]] sumD d[x[0]] * d[x[1]] d[x[0]] d x[0] x 0 d[x[1]] d x[1] x 1 print(sumD) print sumD d = list(map(int, input().split())) list(map(int, input().split())) d combi = list(itertools.combinations(range(N), 2)) list(itertools.combinations(range(N), 2)) combi sumD += d[x[0]] * d[x[1]] d[x[0]] * d[x[1]] sumD N = int(input()) int(input()) N sumD = 0 0 sumD
import itertools

N = int(input())
d = list(map(int, input().split()))

combi = list(itertools.combinations(range(N), 2))
sumD = 0
for x in combi:
    sumD += d[x[0]] * d[x[1]]

print(sumD)
