# cook your dish here
import sys
def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
#file()	
def main(N, arr):

	#initialising with positive infinity value
	maxi=float("inf")

	#initialising the answer variable
	ans=0

	#iterating linesrly
	for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	return ans
        

if __name__ == '__main__':

	#length of the array
	'''N = 4

	#Maximum size of each individual bucket
	Arr = [4,3,2,1]

	#passing the values to the main function
	answer = main(N,Arr)

	#printing the result
	print(answer)'''
	n=int(input())

	l=list(map(int, input().split()))
	ans=0
	for i in range(n):
		for j in range(i+1,n):
			ans+=(l[i]*l[j])
	print(ans)		 import sys sys def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
#file()	 file sys.stdin = open('input.py', 'r') sys.stdin sys stdin open('input.py', 'r') open 'input.py' 'r' sys.stdout = open('output.py', 'w') sys.stdout sys stdout open('output.py', 'w') open 'output.py' 'w' def main(N, arr):

	#initialising with positive infinity value
	maxi=float("inf")

	#initialising the answer variable
	ans=0

	#iterating linesrly
	for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	return ans
         main maxi=float("inf") maxi float("inf") float "inf" ans=0 ans 0 for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	 i range(N) range N maxi=min(maxi,arr[i]) maxi min(maxi,arr[i]) min maxi arr[i] arr i ans+=maxi ans maxi print("dhh") print "dhh" return ans ans N N arr arr if __name__ == '__main__':

	#length of the array
	'''N = 4

	#Maximum size of each individual bucket
	Arr = [4,3,2,1]

	#passing the values to the main function
	answer = main(N,Arr)

	#printing the result
	print(answer)'''
	n=int(input())

	l=list(map(int, input().split()))
	ans=0
	for i in range(n):
		for j in range(i+1,n):
			ans+=(l[i]*l[j])
	print(ans)		 __name__ == '__main__' __name__ '__main__' '''N = 4

	#Maximum size of each individual bucket
	Arr = [4,3,2,1]

	#passing the values to the main function
	answer = main(N,Arr)

	#printing the result
	print(answer)''' n=int(input()) n int(input()) int input() input l=list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans=0 ans 0 for i in range(n):
		for j in range(i+1,n):
			ans+=(l[i]*l[j])
	 i range(n) range n for j in range(i+1,n):
			ans+=(l[i]*l[j])
	 j range(i+1,n) range i+1 i 1 n ans+=(l[i]*l[j]) ans l[i]*l[j] l[i] l i l[j] l j print(ans) print ans n=int(input()) int(input()) n def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
#file()	 def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
#file()	 file ans+=(l[i]*l[j]) l[i]*l[j] ans ans=0 0 ans def main(N, arr):

	#initialising with positive infinity value
	maxi=float("inf")

	#initialising the answer variable
	ans=0

	#iterating linesrly
	for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	return ans
         def main(N, arr):

	#initialising with positive infinity value
	maxi=float("inf")

	#initialising the answer variable
	ans=0

	#iterating linesrly
	for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	return ans
         main l=list(map(int, input().split())) list(map(int, input().split())) l
# cook your dish here
import sys
def file():
	sys.stdin = open('input.py', 'r')
	sys.stdout = open('output.py', 'w') 
#file()	
def main(N, arr):

	#initialising with positive infinity value
	maxi=float("inf")

	#initialising the answer variable
	ans=0

	#iterating linesrly
	for i in range(N):

		#finding minimum at each step
	    maxi=min(maxi,arr[i])
	    #increasing the final ans
	    ans+=maxi
	    print("dhh")

    #returning the answer
	return ans
        

if __name__ == '__main__':

	#length of the array
	'''N = 4

	#Maximum size of each individual bucket
	Arr = [4,3,2,1]

	#passing the values to the main function
	answer = main(N,Arr)

	#printing the result
	print(answer)'''
	n=int(input())

	l=list(map(int, input().split()))
	ans=0
	for i in range(n):
		for j in range(i+1,n):
			ans+=(l[i]*l[j])
	print(ans)		