n=gets.to_i
d=gets.split.map(&:to_i)
sum = 0
d.each_with_index do |i, index1|
  d.each_with_index do |j, index2|
   if index1 == index2 then
    sum += 0
  elsif index1 != index2 then
    sum += i * j
  end
 end
end
print sum/2
