n = int(input())
d = list(map(lambda x: int(x), input().split(" ")))
ans = 0
for i in range(n - 1):
  ans += d[i] * sum(d[i + 1:])
  
print(ans) n = int(input()) n int(input()) int input() input d = list(map(lambda x: int(x), input().split(" "))) d list(map(lambda x: int(x), input().split(" "))) list map(lambda x: int(x), input().split(" ")) map lambda x: int(x) int(x) int x x input().split(" ") ().split () input split " " ans = 0 ans 0 for i in range(n - 1):
  ans += d[i] * sum(d[i + 1:])
   i range(n - 1) range n - 1 n 1 ans += d[i] * sum(d[i + 1:]) ans d[i] * sum(d[i + 1:]) d[i] d i sum(d[i + 1:]) sum d[i + 1:] d i + 1: i + 1 i 1 print(ans) print ans d = list(map(lambda x: int(x), input().split(" "))) list(map(lambda x: int(x), input().split(" "))) d n = int(input()) int(input()) n ans += d[i] * sum(d[i + 1:]) d[i] * sum(d[i + 1:]) ans ans = 0 0 ans
n = int(input())
d = list(map(lambda x: int(x), input().split(" ")))
ans = 0
for i in range(n - 1):
  ans += d[i] * sum(d[i + 1:])
  
print(ans)