n,*d=map(int,open(0).read().split())
ans=0
for i in range(n):
  for j in range(i+1,n):
    ans+=d[i]*d[j]
print(ans) n,*d=map(int,open(0).read().split()) n map(int,open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *d d ans=0 ans 0 for i in range(n):
  for j in range(i+1,n):
    ans+=d[i]*d[j] i range(n) range n for j in range(i+1,n):
    ans+=d[i]*d[j] j range(i+1,n) range i+1 i 1 n ans+=d[i]*d[j] ans d[i]*d[j] d[i] d i d[j] d j print(ans) print ans ans=0 0 ans ans+=d[i]*d[j] d[i]*d[j] ans n,*d=map(int,open(0).read().split()) map(int,open(0).read().split()) n
n,*d=map(int,open(0).read().split())
ans=0
for i in range(n):
  for j in range(i+1,n):
    ans+=d[i]*d[j]
print(ans)