N = gets.to_i C = gets.split.map(&:to_i).sort S = C.sum a = 0 b = 0 C.each_slice(2) do |x, y| a += x b += y if y end puts a.abs - b.abs