import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
d = inpl()
ans = 0
for i in range(N-1):
	for j in range(i+1, N):
		ans += d[i] * d[j]
print(ans)
	

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr) import sys sys import time time import math math def inpl():
    return list(map(int, input().split())) inpl return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split st = time.perf_counter() st time.perf_counter() time.perf_counter time perf_counter N = int(input()) N int(input()) int input() input d = inpl() d inpl() inpl ans = 0 ans 0 for i in range(N-1):
	for j in range(i+1, N):
		ans += d[i] * d[j] i range(N-1) range N-1 N 1 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 ed = time.perf_counter() ed time.perf_counter() time.perf_counter time perf_counter print('time:', ed-st, file=sys.stderr) print 'time:' ed-st ed st file=sys.stderr file sys.stderr sys stderr st = time.perf_counter() time.perf_counter() st ans = 0 0 ans N = int(input()) int(input()) N d = inpl() inpl() d ans += d[i] * d[j] d[i] * d[j] ans ed = time.perf_counter() time.perf_counter() ed def inpl():
    return list(map(int, input().split())) def inpl():
    return list(map(int, input().split())) inpl
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()
# ------------------------------

N = int(input())
d = inpl()
ans = 0
for i in range(N-1):
	for j in range(i+1, N):
		ans += d[i] * d[j]
print(ans)
	

# ------------------------------
ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)
