import itertools

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

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

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

recovery = 0
for i in itertools.combinations(range(n), 2):
    recovery += d[i[0]] * d[i[1]]
print(recovery)