N = int(input())
dd = input().split()
total = 0
for i in range(N-1):
  for j in range(i+1,N):
    total += int(dd[i]) * int(dd[j])
print(total) N = int(input()) N int(input()) int input() input dd = input().split() dd input().split() ().split () input split total = 0 total 0 for i in range(N-1):
  for j in range(i+1,N):
    total += int(dd[i]) * int(dd[j]) i range(N-1) range N-1 N 1 for j in range(i+1,N):
    total += int(dd[i]) * int(dd[j]) j range(i+1,N) range i+1 i 1 N total += int(dd[i]) * int(dd[j]) total int(dd[i]) * int(dd[j]) int(dd[i]) int dd[i] dd i int(dd[j]) int dd[j] dd j print(total) print total total = 0 0 total N = int(input()) int(input()) N total += int(dd[i]) * int(dd[j]) int(dd[i]) * int(dd[j]) total dd = input().split() input().split() dd
N = int(input())
dd = input().split()
total = 0
for i in range(N-1):
  for j in range(i+1,N):
    total += int(dd[i]) * int(dd[j])
print(total)