gets diff = 0 gets.split.map(&:to_i).each do |x| diff += (x % 2 == 0) ? 1 : -1 end puts diff.abs