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