import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(reader.readLine()); String[] inputs = reader.readLine().split(" "); int evenCounter = 0; int oddCounter = 0; for (int i = 0; i < N; i++) { if (Integer.parseInt(inputs[i]) % 2 == 0) { evenCounter += 1; } else { oddCounter += 1; } } System.out.println(Math.abs(evenCounter-oddCounter)); } }