n=int(input())
d=list(map(int,input().split()))
sm=0
for i in range(len(d)-1):
  for j in range(i+1,len(d)):
    sm+=d[i]*d[j]
print(sm) 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 sm=0 sm 0 for i in range(len(d)-1):
  for j in range(i+1,len(d)):
    sm+=d[i]*d[j] i range(len(d)-1) range len(d)-1 len(d) len d 1 for j in range(i+1,len(d)):
    sm+=d[i]*d[j] j range(i+1,len(d)) range i+1 i 1 len(d) len d sm+=d[i]*d[j] sm d[i]*d[j] d[i] d i d[j] d j print(sm) print sm sm+=d[i]*d[j] d[i]*d[j] sm sm=0 0 sm d=list(map(int,input().split())) list(map(int,input().split())) d n=int(input()) int(input()) n
n=int(input())
d=list(map(int,input().split()))
sm=0
for i in range(len(d)-1):
  for j in range(i+1,len(d)):
    sm+=d[i]*d[j]
print(sm)