t = input()
d = list(map(int, input().split()))
cure = 0
for i in range(len(d)):
  for s in range(i+1, len(d)):
    cure += d[i] * d[s]
print(cure) t = input() t 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 cure = 0 cure 0 for i in range(len(d)):
  for s in range(i+1, len(d)):
    cure += d[i] * d[s] i range(len(d)) range len(d) len d for s in range(i+1, len(d)):
    cure += d[i] * d[s] s range(i+1, len(d)) range i+1 i 1 len(d) len d cure += d[i] * d[s] cure d[i] * d[s] d[i] d i d[s] d s print(cure) print cure d = list(map(int, input().split())) list(map(int, input().split())) d cure = 0 0 cure cure += d[i] * d[s] d[i] * d[s] cure t = input() input() t
t = input()
d = list(map(int, input().split()))
cure = 0
for i in range(len(d)):
  for s in range(i+1, len(d)):
    cure += d[i] * d[s]
print(cure)