import itertools

N = int(input())
D = list(map(int, input().split()))


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

N = int(input())
D = list(map(int, input().split()))


d = list(itertools.combinations(D,2))
cnt = 0
for i in d:
    cnt += i[0] * i[1]
print(cnt)
