import java.util.Scanner; public class Main99 { public static void main(String[] args) { Main99 p = new Main99(); } public Main99() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] s = new int[2]; for (int i = 0; i < n; i++) s[Math.abs(sc.nextInt())%2] += 1; System.out.println(s[0]==s[1] ? 0 : 1); } }