import java.io.IOException; public class Main { public static void main(String[] args) throws Exception { int N = nextInt(); boolean[] a = new boolean[(1 << 14) + 1]; a[0] = true; for (int i = 0; i < N; i++) { a[nextInt()] = true; } for (int i = 1; i < a.length; i++) { if (!a[i]) { continue; } for (int j = 1; j < i; j++) { if (a[j]) { a[i ^ j] = true; } } } int ans = 0; for (int i = 0; i < a.length; i++) { if (a[i]) { ans++; } } System.out.println(ans); } static int nextInt() { int c; try { c = System.in.read(); while (c != '-' && (c < '0' || c > '9')) c = System.in.read(); if (c == '-') return -nextInt(); int res = 0; while (c >= '0' && c <= '9') { res = res * 10 + c - '0'; c = System.in.read(); } return res; } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return -1; } }