import itertools
total = 0
recovery = 0
n = int(input())
di = list(map(int, input().split()))
for x in itertools.combinations(di, 2):
  #print(x)
  recovery = x[0] * x[1]
  total += recovery
  #print(total)
print(total) import itertools itertools total = 0 total 0 recovery = 0 recovery 0 n = int(input()) n int(input()) int input() input di = list(map(int, input().split())) di list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split for x in itertools.combinations(di, 2):
  #print(x)
  recovery = x[0] * x[1]
  total += recovery
  #print(total) x itertools.combinations(di, 2) itertools.combinations itertools combinations di 2 recovery = x[0] * x[1] recovery x[0] * x[1] x[0] x 0 x[1] x 1 total += recovery total recovery print(total) print total total = 0 0 total recovery = 0 0 recovery recovery = x[0] * x[1] x[0] * x[1] recovery n = int(input()) int(input()) n total += recovery recovery total di = list(map(int, input().split())) list(map(int, input().split())) di
import itertools
total = 0
recovery = 0
n = int(input())
di = list(map(int, input().split()))
for x in itertools.combinations(di, 2):
  #print(x)
  recovery = x[0] * x[1]
  total += recovery
  #print(total)
print(total)