N = gets.to_i c = gets.split.map(&:to_i).sort a = 0 b = 0 c.reverse_each do |x| a += x a, b = b, a end puts (b.abs - a.abs).abs