n=int(input())
d=list(map(int,input().split()))
l=[x for x in range(n)]


import itertools

p=list(itertools.combinations(l,2))

ans=0

for pp in p:
  ans+=d[pp[0]]*d[pp[1]]

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


import itertools

p=list(itertools.combinations(l,2))

ans=0

for pp in p:
  ans+=d[pp[0]]*d[pp[1]]

print(ans)