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