from itertools import combinations

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

nc2 = list(combinations(d,2))
comb_sum = 0
for x,y in nc2:
  comb_sum += x * y
print(comb_sum) from itertools import combinations 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 nc2 = list(combinations(d,2)) nc2 list(combinations(d,2)) list combinations(d,2) combinations d 2 comb_sum = 0 comb_sum 0 for x,y in nc2:
  comb_sum += x * y x y nc2 comb_sum += x * y comb_sum x * y x y print(comb_sum) print comb_sum n = int(input()) int(input()) n comb_sum = 0 0 comb_sum d = list(map(int,input().split())) list(map(int,input().split())) d comb_sum += x * y x * y comb_sum nc2 = list(combinations(d,2)) list(combinations(d,2)) nc2
from itertools import combinations

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

nc2 = list(combinations(d,2))
comb_sum = 0
for x,y in nc2:
  comb_sum += x * y
print(comb_sum)