#include #include using namespace std; const int _max = 1 << 15; int N; int dp[2][_max]; int main(void) { cin >> N; dp[0][0] = true; for (int n = 1; n <= N; ++n) { int a; cin >> a; for (int i = 0; i < _max; ++i) { dp[n % 2][i] |= dp[(n - 1) % 2][i]; dp[n % 2][i ^ a] |= dp[(n - 1) % 2][i]; } } cout << count(dp[N % 2], dp[N % 2] + _max, true) << endl; return 0; }