N=int(input())
d=list(map(int,input().split()))
res=[0]*N
for i in range(N):
  for j in range(N):
    if(i!=j):
      res[i]+=d[i]*d[j]
print(int(sum(res)/2)) 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 res=[0]*N res [0]*N [0] 0 N for i in range(N):
  for j in range(N):
    if(i!=j):
      res[i]+=d[i]*d[j] i range(N) range N for j in range(N):
    if(i!=j):
      res[i]+=d[i]*d[j] j range(N) range N if(i!=j):
      res[i]+=d[i]*d[j] i!=j i j res[i]+=d[i]*d[j] res[i] res i d[i]*d[j] d[i] d i d[j] d j print(int(sum(res)/2)) print int(sum(res)/2) int sum(res)/2 sum(res) sum res 2 N=int(input()) int(input()) N res=[0]*N [0]*N res d=list(map(int,input().split())) list(map(int,input().split())) d
N=int(input())
d=list(map(int,input().split()))
res=[0]*N
for i in range(N):
  for j in range(N):
    if(i!=j):
      res[i]+=d[i]*d[j]
print(int(sum(res)/2))