N = int(input())
a = input().split()

sum = 0

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

sum = 0

for i in range(N-1):
  for j in range(i+1,N):
    #print(int(a[i])*int(a[j]))
    sum += int(a[i])*int(a[j])
  
print(sum)