import java.util.Scanner; class N099{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int n = s.nextInt(); int gu = 0, ki = 0; for(int i = 0; i < n; i++){ if(s.nextInt() % 2 == 0){ gu++; }else{ ki++; } } System.out.println(Math.abs(gu - ki)); } }