import sys
# from math import sqrt, gcd, ceil, log
# from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)



def solve():
	n = int(input()); arr = read()
	ans= 0
	for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	print(ans)


		

if __name__ == "__main__":
	solve() import sys sys from collections import defaultdict, Counter inp = sys.stdin.readline inp sys.stdin.readline sys.stdin sys stdin readline read = lambda: list(map(int, inp().strip().split())) read lambda: list(map(int, inp().strip().split())) list(map(int, inp().strip().split())) list map(int, inp().strip().split()) map int inp().strip().split() ().strip().split ().strip() ().strip () inp strip split def solve():
	n = int(input()); arr = read()
	ans= 0
	for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	print(ans)


		 solve n = int(input()) n int(input()) int input() input arr = read() arr read() read ans= 0 ans 0 for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	 i range(n) range n for j in range(i+1, n):
			ans += arr[i]*arr[j]
	 j range(i+1, n) range i+1 i 1 n ans += arr[i]*arr[j] ans arr[i]*arr[j] arr[i] arr i arr[j] arr j print(ans) print ans if __name__ == "__main__":
	solve() __name__ == "__main__" __name__ "__main__" solve() solve inp = sys.stdin.readline sys.stdin.readline inp def solve():
	n = int(input()); arr = read()
	ans= 0
	for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	print(ans)


		 def solve():
	n = int(input()); arr = read()
	ans= 0
	for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	print(ans)


		 solve read = lambda: list(map(int, inp().strip().split())) lambda: list(map(int, inp().strip().split())) read
import sys
# from math import sqrt, gcd, ceil, log
# from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))

# sys.setrecursionlimit(10**6)



def solve():
	n = int(input()); arr = read()
	ans= 0
	for i in range(n):
		for j in range(i+1, n):
			ans += arr[i]*arr[j]
	print(ans)


		

if __name__ == "__main__":
	solve()
