n = gets.to_i a = gets.split.map(&:to_i) o = a.count{|i| i.odd?} e = n - o p n - [o,e].min * 2