import java.io.*; import java.util.*; class Main { public static void out (Object o) { System.out.println(o); } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int max = 1 << 15; boolean[] dp = new boolean[max]; boolean[] check = new boolean[max]; int n = Integer.parseInt(br.readLine()); String[] line = br.readLine().split(" "); int[] nums = new int[n]; for (int i = 0; i < n; i++) nums[i] = Integer.parseInt(line[i]); for (int i = 0; i < n; i++) { dp[nums[i]] = true; for (int j = 0; j < max; j++) { if (!dp[j]) continue; dp[j^nums[i]] = true; check[j^nums[i]] = true; } Arrays.fill(check , false); } int ans = 0; for (int i = 0; i < max; i++) if (dp[i]) ans++; out(ans); } }