def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
d = intl()

ans = 0
for i in range(n):
	for j in range(i+1,n):
		ans += d[i]*d[j]
print(ans) def i():
	return int(input()) i return int(input()) int(input()) int input() input def i2():
	return map(int,input().split()) i2 return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def s():
	return str(input()) s return str(input()) str(input()) str input() input def l():
	return list(input()) l return list(input()) list(input()) list input() input def intl():
	return list(int(k) for k in input().split()) intl return list(int(k) for k in input().split()) list(int(k) for k in input().split()) list int(k) int k n = i() n i() i d = intl() d intl() intl ans = 0 ans 0 for i in range(n):
	for j in range(i+1,n):
		ans += d[i]*d[j] i range(n) range n for j in range(i+1,n):
		ans += d[i]*d[j] j range(i+1,n) range i+1 i 1 n ans += d[i]*d[j] ans d[i]*d[j] d[i] d i d[j] d j print(ans) print ans ans += d[i]*d[j] d[i]*d[j] ans def l():
	return list(input()) def l():
	return list(input()) l n = i() i() n def s():
	return str(input()) def s():
	return str(input()) s def i():
	return int(input()) def i():
	return int(input()) i def i2():
	return map(int,input().split()) def i2():
	return map(int,input().split()) i2 ans = 0 0 ans def intl():
	return list(int(k) for k in input().split()) def intl():
	return list(int(k) for k in input().split()) intl d = intl() intl() d
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()
d = intl()

ans = 0
for i in range(n):
	for j in range(i+1,n):
		ans += d[i]*d[j]
print(ans)