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