#include #include using namespace std; static const int NMAX = 5000; static const int AMAX = 16384; int main(){ int N; cin >> N; bool memo[N + 1][AMAX + 1]; int A[N]; for(int i = 0; i < N; i++) cin >> A[i]; for(int i = 0; i <= N; i++){ for(int j = 0; j <= AMAX; j++){ memo[i][j] = false; } } memo[0][0] = 1; for(int i = 0; i < N; i++){ for(int j = 0; j <= AMAX; j++){ if(memo[i][j]){ memo[i + 1][(j ^ A[i])] = true; memo[i + 1][j] = true; } } } int result = 0; for(int i = 0; i <= AMAX; i++){ if(memo[N][i]){ result++; } } cout << result << endl; }