N = int(input())
D_ls = list(map(int, input().split(' ')))
result = 0
for i in range(N):
    for j in range(i+1, N):
        result += D_ls[i] * D_ls[j]
print(result) N = int(input()) N int(input()) int input() input D_ls = list(map(int, input().split(' '))) D_ls list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' result = 0 result 0 for i in range(N):
    for j in range(i+1, N):
        result += D_ls[i] * D_ls[j] i range(N) range N for j in range(i+1, N):
        result += D_ls[i] * D_ls[j] j range(i+1, N) range i+1 i 1 N result += D_ls[i] * D_ls[j] result D_ls[i] * D_ls[j] D_ls[i] D_ls i D_ls[j] D_ls j print(result) print result N = int(input()) int(input()) N result = 0 0 result D_ls = list(map(int, input().split(' '))) list(map(int, input().split(' '))) D_ls result += D_ls[i] * D_ls[j] D_ls[i] * D_ls[j] result
N = int(input())
D_ls = list(map(int, input().split(' ')))
result = 0
for i in range(N):
    for j in range(i+1, N):
        result += D_ls[i] * D_ls[j]
print(result)