class Calc0099 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @xs = args.shift.map(&:to_i) end def run evens = @xs.count(&:even?) odds = (@xs.size - evens) (evens - odds).abs end end puts Calc0099.new(STDIN.readlines).run if __FILE__ == $0