n = int(input())
D = list(map(int, input().split()))
sum = 0
for i in range(n):
    for j in range(n):
        if i != j:
            sum += D[i] * D[j]
print(sum // 2) 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 sum = 0 sum 0 for i in range(n):
    for j in range(n):
        if i != j:
            sum += D[i] * D[j] i range(n) range n for j in range(n):
        if i != j:
            sum += D[i] * D[j] j range(n) range n if i != j:
            sum += D[i] * D[j] i != j i j sum += D[i] * D[j] sum D[i] * D[j] D[i] D i D[j] D j print(sum // 2) print sum // 2 sum 2 sum = 0 0 sum n = int(input()) int(input()) n D = list(map(int, input().split())) list(map(int, input().split())) D sum += D[i] * D[j] D[i] * D[j] sum
n = int(input())
D = list(map(int, input().split()))
sum = 0
for i in range(n):
    for j in range(n):
        if i != j:
            sum += D[i] * D[j]
print(sum // 2)