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