N = int(input())
D = list(map(int,input().split()))
ans = 0

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

for n in range(N-1):
  ans+=sum(D[n]*D[n+1:])
  
print(ans)