n = int(input())
data = list(map(int, input().split()))
sum = 0
for i in range(n):
    for j in range(i):
        if i == j:
            continue
        else:
            sum +=  data[i] * data[j]
            # print(sum)

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

print(sum)
