import itertools

import operator





N = int(eval(input()))

d = list(map(int, input().split()))



n = N * (N - 1) // 2

l = []

c = list(itertools.combinations(d, 2))

for i in range(n):

    l.append(operator.mul(c[i][0], c[i][1]))

ans = sum(l)

print(ans)
import itertools





N = int(eval(input()))

d = list(map(int, input().split()))



ans = 0

c = list(itertools.combinations(d, 2))

for x in c:

    ans += x[0] * x[1]

print(ans)
import itertools
import operator

N = int(eval(input()))
d = list(map(int, input().split()))
n = N * (N - 1) // 2
l = []
c = list(itertools.combinations(d, 2))
for i in range(n):
    l.append(operator.mul(c[i][0], c[i][1]))
ans = sum(l)
print(ans)

import itertools

N = int(eval(input()))
d = list(map(int, input().split()))
ans = 0
c = list(itertools.combinations(d, 2))
for x in c:
    ans += x[0] * x[1]
print(ans)

-import operator -n = N * (N - 1) // 2 -l = [] +ans = 0 -for i in range(n): -    l.append(operator.mul(c[i][0], c[i][1])) -ans = sum(l) +for x in c: +    ans += x[0] * x[1]