from itertools import combinations
N = int(input())
D = list(map(int, input().split()))
res = 0
for x, y in combinations(D, 2):
    res += x*y
print(res) from itertools import combinations 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 res = 0 res 0 for x, y in combinations(D, 2):
    res += x*y x y combinations(D, 2) combinations D 2 res += x*y res x*y x y print(res) print res res = 0 0 res D = list(map(int, input().split())) list(map(int, input().split())) D res += x*y x*y res N = int(input()) int(input()) N
from itertools import combinations
N = int(input())
D = list(map(int, input().split()))
res = 0
for x, y in combinations(D, 2):
    res += x*y
print(res)