n = int(input())
a = [int(x) for x in input().split()]
res = 0
for i in range(n):
  for j in range(i+1,n):
    res += a[i] * a[j]
print(res) n = int(input()) n int(input()) int input() input 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 a = [int(x) for x in input().split()] a [int(x) for x in input().split()] res = 0 res 0 for i in range(n):
  for j in range(i+1,n):
    res += a[i] * a[j] i range(n) range n for j in range(i+1,n):
    res += a[i] * a[j] j range(i+1,n) range i+1 i 1 n res += a[i] * a[j] res a[i] * a[j] a[i] a i a[j] a j print(res) print res a = [int(x) for x in input().split()] [int(x) for x in input().split()] a res = 0 0 res res += a[i] * a[j] a[i] * a[j] res n = int(input()) int(input()) n
n = int(input())
a = [int(x) for x in input().split()]
res = 0
for i in range(n):
  for j in range(i+1,n):
    res += a[i] * a[j]
print(res)