import itertools

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

n = int(input())
d = list(map(int,input().split()))
ans = 0
for v in itertools.combinations(d, 2):
  ans += v[0]*v[1]
print(ans)