N = gets.to_i A = gets.split.map(&:to_i).sort.reverse puts A.each_slice(2).map { |a, b| a * b }.sum