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

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

import itertools
e = itertools.combinations(list(range(n)),2)
ans = 0
for i,j in e:
  ans += d[i] * d[j]
print(ans)