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