n = gets.chomp.to_i
d = gets.chomp.split(' ').map(&:to_i)
n -= 1
a = 0
b = 0
(0..n).each do |i|
  (1..n).each do |j|
    a = a + d[i] *d[j] 
  end
end
(0..n).each do |i|
  (1..i).each do |j|
    b = b + d[i] *d[j] 
  end
end
ans = a - b
puts ans