import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class No99 { public static void main(String[] args) throws IOException{ //ジャンピング駒 String[] str = readStr(); int N = Integer.parseInt(str[0]) , count = 0; String[] X = str[1].split(" "); for(int i = 0;i < N;i++) { if(Integer.parseInt(X[i]) % 2 == 0) { count += 1; }else { count -= 1; } } System.out.println((int)Math.abs(count)); } public static String[] readStr() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList list = new ArrayList<>(); do { list.add(br.readLine()); }while(br.ready()); br.close(); String[] text = new String[list.size()]; list.toArray(text); return text; } }