import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); long[] arr = new long[N]; for(int i = 0; i < N; i++){ arr[i] = sc.nextLong(); } Arrays.sort(arr); for(int i = 0; i < N; i++){ arr[i] = Math.abs(arr[i]) % 2; } int ones = 0, zeros = 0; for(int i = 0; i < N; i++){ if(arr[i] == 0){ zeros++; }else{ ones++; } } System.out.println(Math.max(ones, zeros) - Math.min(ones, zeros)); } }