N = int(input())
D = list(map(int, input().split()))
assert len(D) == N

# i個目のたこ焼のうまさDi
# おいしさがx,yのたこやき2個を食べると体力がxy回復
total = 0
for i,x in enumerate(D[:-1]):
  for y in D[i+1:]:
    total += x * y
print(total) 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 assert len(D) == N len(D) == N len(D) len D N total = 0 total 0 for i,x in enumerate(D[:-1]):
  for y in D[i+1:]:
    total += x * y i x enumerate(D[:-1]) enumerate D[:-1] D :-1 -1 for y in D[i+1:]:
    total += x * y y D[i+1:] D i+1: i+1 i 1 total += x * y total x * y x y print(total) print total total = 0 0 total N = int(input()) int(input()) N total += x * y x * y total D = list(map(int, input().split())) list(map(int, input().split())) D
N = int(input())
D = list(map(int, input().split()))
assert len(D) == N

# i個目のたこ焼のうまさDi
# おいしさがx,yのたこやき2個を食べると体力がxy回復
total = 0
for i,x in enumerate(D[:-1]):
  for y in D[i+1:]:
    total += x * y
print(total)