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

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

ans = 0
for x in range(N-1):
  for y in range(x+1,N):
    ans += S[x]*S[y]
print(ans)