import itertools
n = int(input())

d = list(map(int,input().split()))
ans = 0

a = list(itertools.combinations(d, 2))

print(sum(i*j for i, j in a)) 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 ans = 0 ans 0 a = list(itertools.combinations(d, 2)) a list(itertools.combinations(d, 2)) list itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 print(sum(i*j for i, j in a)) print sum(i*j for i, j in a) sum i*j i j ans = 0 0 ans a = list(itertools.combinations(d, 2)) list(itertools.combinations(d, 2)) a d = list(map(int,input().split())) list(map(int,input().split())) d n = int(input()) int(input()) n
import itertools
n = int(input())

d = list(map(int,input().split()))
ans = 0

a = list(itertools.combinations(d, 2))

print(sum(i*j for i, j in a))
