n = int(raw_input())
elems = map(int, raw_input().split(' '))
cumul = 0
res = 0
for j in range(len(elems)):
	res += elems[j] * cumul
	cumul += elems[j]
print res n = int(raw_input()) n int(raw_input()) int raw_input() raw_input elems = map(int, raw_input().split(' ')) elems map(int, raw_input().split(' ')) map int raw_input().split(' ') ().split () raw_input split ' ' cumul = 0 cumul 0 res = 0 res 0 for j in range(len(elems)):
	res += elems[j] * cumul
	cumul += elems[j] j range(len(elems)) range len(elems) len elems res += elems[j] * cumul res elems[j] * cumul elems[j] elems j cumul cumul += elems[j] cumul elems[j] elems j print cumul = 0 0 cumul cumul += elems[j] elems[j] cumul n = int(raw_input()) int(raw_input()) n res += elems[j] * cumul elems[j] * cumul res res = 0 0 res elems = map(int, raw_input().split(' ')) map(int, raw_input().split(' ')) elems
n = int(raw_input())
elems = map(int, raw_input().split(' '))
cumul = 0
res = 0
for j in range(len(elems)):
	res += elems[j] * cumul
	cumul += elems[j]
print res
