N = gets.to_i X = gets.split.map(&:to_i) a = X.count {|x| x % 2 == 0} b = X.size - a ans = (a - b).abs puts ans