#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define N_MAX 5000 using namespace std; int main(void) { int N, A[N_MAX]; cin >> N; for (int i = 0; i < N; i++) { cin >> A[i]; } bool *can_make = new bool[1 << 15](); queue q; q.push(0); while (!q.empty()) { int x = q.front(); q.pop(); if (can_make[x]) { continue; } can_make[x] = true; for (int i = 0; i < N; i++) { int y = x ^ A[i]; if (!can_make[y]) { q.push(y); } } } cout << accumulate(can_make, can_make + (1 << 15), 0) << endl; return 0; }