#include #include #include using namespace std; int main() { int n; cin >> n; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } bool available[2][1 << 15] = { false }; available[0][0] = true; for (int i = 0; i < n; ++i) { for (size_t x = 0; x < (1 << 15); ++x) { if (available[i % 2][x]) { int newX = x ^ a[i]; available[(i + 1) % 2][newX] = true; available[(i + 1) % 2][x] = true; } } } int result = count(&available[n % 2][0], &available[n % 2][(1 << 15) - 1] + 1, true); cout << result << endl; return 0; }