import itertools
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i, j in itertools.combinations(a, 2):
  cnt += i*j
print(cnt) import itertools itertools n = int(input()) n int(input()) int input() input a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split cnt = 0 cnt 0 for i, j in itertools.combinations(a, 2):
  cnt += i*j i j itertools.combinations(a, 2) itertools.combinations itertools combinations a 2 cnt += i*j cnt i*j i j print(cnt) print cnt n = int(input()) int(input()) n cnt = 0 0 cnt a = list(map(int,input().split())) list(map(int,input().split())) a cnt += i*j i*j cnt
import itertools
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i, j in itertools.combinations(a, 2):
  cnt += i*j
print(cnt)