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