import itertools

N = int(input())
d_int_list = list(map(int, input().split()))
comb_list = list(itertools.combinations(d_int_list, 2))
ans = 0

for i in comb_list:
    ans += i[0] * i[1]

print(ans) import itertools itertools N = int(input()) N int(input()) int input() input d_int_list = list(map(int, input().split())) d_int_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split comb_list = list(itertools.combinations(d_int_list, 2)) comb_list list(itertools.combinations(d_int_list, 2)) list itertools.combinations(d_int_list, 2) itertools.combinations itertools combinations d_int_list 2 ans = 0 ans 0 for i in comb_list:
    ans += i[0] * i[1] i comb_list ans += i[0] * i[1] ans i[0] * i[1] i[0] i 0 i[1] i 1 print(ans) print ans ans = 0 0 ans d_int_list = list(map(int, input().split())) list(map(int, input().split())) d_int_list N = int(input()) int(input()) N comb_list = list(itertools.combinations(d_int_list, 2)) list(itertools.combinations(d_int_list, 2)) comb_list ans += i[0] * i[1] i[0] * i[1] ans
import itertools

N = int(input())
d_int_list = list(map(int, input().split()))
comb_list = list(itertools.combinations(d_int_list, 2))
ans = 0

for i in comb_list:
    ans += i[0] * i[1]

print(ans)
