from itertools import combinations

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

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

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

ans=0
for a,b in combinations(range(n),2):
  ans+=D[a]*D[b]
  
print(ans)