n=int(input())
a=[int(i) for i in input().split()]
sum=0
for i in range(0,len(a)-1):
    for j in range(i+1,len(a)):
        sum=sum+(a[i]*a[j])
print(sum) n=int(input()) n int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a=[int(i) for i in input().split()] a [int(i) for i in input().split()] sum=0 sum 0 for i in range(0,len(a)-1):
    for j in range(i+1,len(a)):
        sum=sum+(a[i]*a[j]) i range(0,len(a)-1) range 0 len(a)-1 len(a) len a 1 for j in range(i+1,len(a)):
        sum=sum+(a[i]*a[j]) j range(i+1,len(a)) range i+1 i 1 len(a) len a sum=sum+(a[i]*a[j]) sum sum+(a[i]*a[j]) sum a[i]*a[j] a[i] a i a[j] a j print(sum) print sum a=[int(i) for i in input().split()] [int(i) for i in input().split()] a n=int(input()) int(input()) n sum=0 0 sum sum=sum+(a[i]*a[j]) sum+(a[i]*a[j]) sum
n=int(input())
a=[int(i) for i in input().split()]
sum=0
for i in range(0,len(a)-1):
    for j in range(i+1,len(a)):
        sum=sum+(a[i]*a[j])
print(sum)