n = gets.to_i x_ary = gets.chomp.split(" ").map(&:to_i) even_ary = Array.new odd_ary = Array.new even_count = 0 odd_count = 0 x_ary.each do |x| if x % 2 == 0 even_count += 1 even_ary.push(x) else odd_count += 1 odd_ary.push(x) end end puts (even_count - odd_count).abs