n=int(input())
A=input().split()
def findProductSum(A,n): 
  
    product = 0
    for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
    return product
print(findProductSum(A,n)) n=int(input()) n int(input()) int input() input A=input().split() A input().split() ().split () input split def findProductSum(A,n): 
  
    product = 0
    for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
    return product findProductSum product = 0 product 0 for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
     i range (n) range n for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
     j range ( i+1,n) range i+1 i 1 n product = product + int(A[i])*int(A[j]) product product + int(A[i])*int(A[j]) product int(A[i])*int(A[j]) int(A[i]) int A[i] A i int(A[j]) int A[j] A j return product product A A n n print(findProductSum(A,n)) print findProductSum(A,n) findProductSum A n n=int(input()) int(input()) n def findProductSum(A,n): 
  
    product = 0
    for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
    return product def findProductSum(A,n): 
  
    product = 0
    for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
    return product findProductSum A=input().split() input().split() A
n=int(input())
A=input().split()
def findProductSum(A,n): 
  
    product = 0
    for i in range (n): 
        for j in range ( i+1,n): 
            product = product + int(A[i])*int(A[j])
    return product
print(findProductSum(A,n))