n = int(input())
d = [int(i) for i in input().split()]
ret = 0
for i in range(n):
	for j in range(i + 1, n):
		ret += d[i] * d[j]
print (ret) n = int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i d = [int(i) for i in input().split()] d [int(i) for i in input().split()] ret = 0 ret 0 for i in range(n):
	for j in range(i + 1, n):
		ret += d[i] * d[j] i range(n) range n for j in range(i + 1, n):
		ret += d[i] * d[j] j range(i + 1, n) range i + 1 i 1 n ret += d[i] * d[j] ret d[i] * d[j] d[i] d i d[j] d j print (ret) print ret d = [int(i) for i in input().split()] [int(i) for i in input().split()] d ret = 0 0 ret n = int(input()) int(input()) n ret += d[i] * d[j] d[i] * d[j] ret
n = int(input())
d = [int(i) for i in input().split()]
ret = 0
for i in range(n):
	for j in range(i + 1, n):
		ret += d[i] * d[j]
print (ret)