import java.util.*; import java.util.stream.*; class Main { static Scanner s=new Scanner(System.in); static int gInt(){return Integer.parseInt(s.next());} public static void main(String[]$){ int n=gInt(); int[]a={0,0}; IntStream.range(0,n).map(i->gInt()+1000000000).forEach(o->++a[o%2]); System.out.println(Math.abs(a[0]-a[1])); } }