import itertools



n = int(eval(input()))

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



ans = 0

for v in list(itertools.combinations(d, 2)):

    ans += (v[0] * v[1])



print(ans)

import itertools



n = int(eval(input()))

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



'''

ans = 0

for v in list(itertools.combinations(d, 2)):

    ans += (v[0] * v[1])



print(ans)

'''



ans = 0

for i in range(n):

    for j in range(i+1, n):

        ans += d[i] * d[j]



print(ans)

import itertools

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

import itertools

n = int(eval(input()))
d = list(map(int, input().split()))
"""
ans = 0
for v in list(itertools.combinations(d, 2)):
    ans += (v[0] * v[1])
print(ans)
"""
ans = 0
for i in range(n):
    for j in range(i + 1, n):
        ans += d[i] * d[j]
print(ans)

+""" -    ans += v[0] * v[1] +    ans += (v[0] * v[1]) +""" +ans = 0 +for i in range(n): +    for j in range(i + 1, n): +        ans += d[i] * d[j] +print(ans)