N = gets.to_i
D = gets.split.map(&:to_i)

answer = 0

(0..N-1).each do |first|
  (0..N-1).each do |second|
    if first == second
      next
    else
      answer +=  D[first] * D[second]
    end
  end
end

answer /= 2
p answer
