N = int(input())
x = list(map(int,input().rstrip().split()))
ans = 0
for i in range(N):
    for j in range(i+1,N):
        ans+=x[i]*x[j]
print(ans) N = int(input()) N int(input()) int input() input x = list(map(int,input().rstrip().split())) x list(map(int,input().rstrip().split())) list map(int,input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split ans = 0 ans 0 for i in range(N):
    for j in range(i+1,N):
        ans+=x[i]*x[j] i range(N) range N for j in range(i+1,N):
        ans+=x[i]*x[j] j range(i+1,N) range i+1 i 1 N ans+=x[i]*x[j] ans x[i]*x[j] x[i] x i x[j] x j print(ans) print ans x = list(map(int,input().rstrip().split())) list(map(int,input().rstrip().split())) x ans+=x[i]*x[j] x[i]*x[j] ans N = int(input()) int(input()) N ans = 0 0 ans
N = int(input())
x = list(map(int,input().rstrip().split()))
ans = 0
for i in range(N):
    for j in range(i+1,N):
        ans+=x[i]*x[j]
print(ans)