N = int(input())
d = list(map(int,input().split()))
ans = 0
for k in range(N-1):
    for l in range(k+1,N):
        ans += d[k]*d[l]
print(ans) 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 ans = 0 ans 0 for k in range(N-1):
    for l in range(k+1,N):
        ans += d[k]*d[l] k range(N-1) range N-1 N 1 for l in range(k+1,N):
        ans += d[k]*d[l] l range(k+1,N) range k+1 k 1 N ans += d[k]*d[l] ans d[k]*d[l] d[k] d k d[l] d l print(ans) print ans N = int(input()) int(input()) N ans += d[k]*d[l] d[k]*d[l] ans d = list(map(int,input().split())) list(map(int,input().split())) d ans = 0 0 ans
N = int(input())
d = list(map(int,input().split()))
ans = 0
for k in range(N-1):
    for l in range(k+1,N):
        ans += d[k]*d[l]
print(ans)
