n = int(input())
hp = list(map(int, input().split()))
sum = 0

for i in range(n):
  for j in range(n):
    if i != j:
      sum += (hp[i]*hp[j])

sum = int(sum/2)
print(sum)


   n = int(input()) n int(input()) int input() input hp = list(map(int, input().split())) hp list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split sum = 0 sum 0 for i in range(n):
  for j in range(n):
    if i != j:
      sum += (hp[i]*hp[j]) i range(n) range n for j in range(n):
    if i != j:
      sum += (hp[i]*hp[j]) j range(n) range n if i != j:
      sum += (hp[i]*hp[j]) i != j i j sum += (hp[i]*hp[j]) sum hp[i]*hp[j] hp[i] hp i hp[j] hp j sum = int(sum/2) sum int(sum/2) int sum/2 sum 2 print(sum) print sum sum = int(sum/2) int(sum/2) sum hp = list(map(int, input().split())) list(map(int, input().split())) hp n = int(input()) int(input()) n sum = 0 0 sum sum += (hp[i]*hp[j]) hp[i]*hp[j] sum
n = int(input())
hp = list(map(int, input().split()))
sum = 0

for i in range(n):
  for j in range(n):
    if i != j:
      sum += (hp[i]*hp[j])

sum = int(sum/2)
print(sum)


  
