# -*- coding: utf-8 -*-
from itertools import combinations

n = int(input())
d = list(map(int, input().split()))

pairs = combinations(d, 2)

print(sum(map(lambda x: x[0]*x[1], pairs))) 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 pairs = combinations(d, 2) pairs combinations(d, 2) combinations d 2 print(sum(map(lambda x: x[0]*x[1], pairs))) print sum(map(lambda x: x[0]*x[1], pairs)) sum map(lambda x: x[0]*x[1], pairs) map lambda x: x[0]*x[1] x[0]*x[1] x[0] x 0 x[1] x 1 x pairs pairs = combinations(d, 2) combinations(d, 2) pairs n = int(input()) int(input()) n d = list(map(int, input().split())) list(map(int, input().split())) d
# -*- coding: utf-8 -*-
from itertools import combinations

n = int(input())
d = list(map(int, input().split()))

pairs = combinations(d, 2)

print(sum(map(lambda x: x[0]*x[1], pairs)))
