import itertools

n = int(input())
d = list(map(int, input().split()))
sum = 0

for i in itertools.combinations(d, 2):
    sum += i[0] * i[1]

print(sum) import itertools itertools 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 itertools.combinations(d, 2):
    sum += i[0] * i[1] i itertools.combinations(d, 2) itertools.combinations itertools combinations d 2 sum += i[0] * i[1] sum i[0] * i[1] i[0] i 0 i[1] i 1 print(sum) print sum d = list(map(int, input().split())) list(map(int, input().split())) d sum += i[0] * i[1] i[0] * i[1] sum n = int(input()) int(input()) n sum = 0 0 sum
import itertools

n = int(input())
d = list(map(int, input().split()))
sum = 0

for i in itertools.combinations(d, 2):
    sum += i[0] * i[1]

print(sum)
