import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); int even = 0; int odd = 0; int N = scan.nextInt(); long X; for (int i = 0; i < N; i++) { X = scan.nextLong(); if (X%2==0) even++; else odd++; } System.out.println(Math.abs(even - odd)); } }