N=int(input())
d=list(map(int,input().split()))

a=0
for i in range(N):
    for k in range(1,N-i):
        a=a+d[i]*d[i+k]
print(a) 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 a=0 a 0 for i in range(N):
    for k in range(1,N-i):
        a=a+d[i]*d[i+k] i range(N) range N for k in range(1,N-i):
        a=a+d[i]*d[i+k] k range(1,N-i) range 1 N-i N i a=a+d[i]*d[i+k] a a+d[i]*d[i+k] a d[i]*d[i+k] d[i] d i d[i+k] d i+k i k print(a) print a a=a+d[i]*d[i+k] a+d[i]*d[i+k] a a=0 0 a 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()))

a=0
for i in range(N):
    for k in range(1,N-i):
        a=a+d[i]*d[i+k]
print(a)