import sys
import itertools
N = int(input())
array = list(map(int,input().split()))

sum = 0
for I in list(itertools.combinations(array,2)):
    sum += I[0]*I[1]
print(sum) import sys sys import itertools itertools N = int(input()) N int(input()) int input() input array = list(map(int,input().split())) array list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split sum = 0 sum 0 for I in list(itertools.combinations(array,2)):
    sum += I[0]*I[1] I list(itertools.combinations(array,2)) list itertools.combinations(array,2) itertools.combinations itertools combinations array 2 sum += I[0]*I[1] sum I[0]*I[1] I[0] I 0 I[1] I 1 print(sum) print sum N = int(input()) int(input()) N sum = 0 0 sum array = list(map(int,input().split())) list(map(int,input().split())) array sum += I[0]*I[1] I[0]*I[1] sum
import sys
import itertools
N = int(input())
array = list(map(int,input().split()))

sum = 0
for I in list(itertools.combinations(array,2)):
    sum += I[0]*I[1]
print(sum)
