import math 
import itertools

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

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