import itertools

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

total = 0
for i in itertools.combinations(d_list, 2):
    x, y = i
    total += x*y
    
print(total) import itertools itertools N = int(input()) N int(input()) int input() input d_list = list(map(int, input().split())) d_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split total = 0 total 0 for i in itertools.combinations(d_list, 2):
    x, y = i
    total += x*y
     i itertools.combinations(d_list, 2) itertools.combinations itertools combinations d_list 2 x, y = i x i y total += x*y total x*y x y print(total) print total d_list = list(map(int, input().split())) list(map(int, input().split())) d_list total += x*y x*y total N = int(input()) int(input()) N total = 0 0 total y = i i y x, y = i i x
import itertools

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

total = 0
for i in itertools.combinations(d_list, 2):
    x, y = i
    total += x*y
    
print(total)