N = int(input())
Tot = 0
d = [int(x) for x in input().split()]  
for i in range(N):
  for j in range(N):
    if i > j:
      # print(i , j)
      Tot += d[i] *d[j]
print(Tot) N = int(input()) N int(input()) int input() input Tot = 0 Tot 0 int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x d = [int(x) for x in input().split()] d [int(x) for x in input().split()] for i in range(N):
  for j in range(N):
    if i > j:
      # print(i , j)
      Tot += d[i] *d[j] i range(N) range N for j in range(N):
    if i > j:
      # print(i , j)
      Tot += d[i] *d[j] j range(N) range N if i > j:
      # print(i , j)
      Tot += d[i] *d[j] i > j i j Tot += d[i] *d[j] Tot d[i] *d[j] d[i] d i d[j] d j print(Tot) print Tot d = [int(x) for x in input().split()] [int(x) for x in input().split()] d Tot += d[i] *d[j] d[i] *d[j] Tot N = int(input()) int(input()) N Tot = 0 0 Tot
N = int(input())
Tot = 0
d = [int(x) for x in input().split()]  
for i in range(N):
  for j in range(N):
    if i > j:
      # print(i , j)
      Tot += d[i] *d[j]
print(Tot)