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