import itertools

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

P = 0
for i in itertools.permutations(D, 2):
    P += i[0]*i[1]

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

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

P = 0
for i in itertools.permutations(D, 2):
    P += i[0]*i[1]

print(P // 2)