import itertools

N, *D = map(int, open(0).read().split())
ans = 0
for v in itertools.combinations(D, 2):
    ans += v[0] * v[1]

print(ans) import itertools itertools N, *D = map(int, open(0).read().split()) N map(int, open(0).read().split()) map int open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *D D ans = 0 ans 0 for v in itertools.combinations(D, 2):
    ans += v[0] * v[1] v itertools.combinations(D, 2) itertools.combinations itertools combinations D 2 ans += v[0] * v[1] ans v[0] * v[1] v[0] v 0 v[1] v 1 print(ans) print ans ans += v[0] * v[1] v[0] * v[1] ans ans = 0 0 ans N, *D = map(int, open(0).read().split()) map(int, open(0).read().split()) N
import itertools

N, *D = map(int, open(0).read().split())
ans = 0
for v in itertools.combinations(D, 2):
    ans += v[0] * v[1]

print(ans)