#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); can_make[0] = true; while (!q.empty()) { int x = q.front(); q.pop(); can_make[x] = true; for (int i = 0; i < N; i++) { int y = x ^ A[i]; if (!can_make[y]) { q.push(y); can_make[y] = true; } } } cout << accumulate(can_make, can_make + (1 << 15), 0) << endl; return 0; }