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