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