N = int(input())
*d, = map(int, input().split())
sum = 0
for i in range(len(d)):
    for j in range(i+1, len(d)):
        sum+=d[i]*d[j]
print(sum) N = int(input()) N int(input()) int input() input *d, = map(int, input().split()) *d d map(int, input().split()) map int input().split() ().split () input split sum = 0 sum 0 for i in range(len(d)):
    for j in range(i+1, len(d)):
        sum+=d[i]*d[j] i range(len(d)) range len(d) len d for j in range(i+1, len(d)):
        sum+=d[i]*d[j] j range(i+1, len(d)) range i+1 i 1 len(d) len d sum+=d[i]*d[j] sum d[i]*d[j] d[i] d i d[j] d j print(sum) print sum N = int(input()) int(input()) N sum = 0 0 sum sum+=d[i]*d[j] d[i]*d[j] sum
N = int(input())
*d, = map(int, input().split())
sum = 0
for i in range(len(d)):
    for j in range(i+1, len(d)):
        sum+=d[i]*d[j]
print(sum)