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