n,*a=$<.read.split.map &:to_i;p (a.count{|e|e%2<1}*2-n).abs