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