#include #include #include #include #include #include #include using namespace std; using ll = long long; const ll INF = 1e9; const ll MOD = 1e9 + 7; bool dp[5010][165000]; // dp[i][k] = a[0] ~ a[i] までで k が作れるか int main() { int N; cin >> N; ll a[N]; for (int i = 0; i < N; i++) { cin >> a[i]; } dp[0][0] = true; for (int i = 0; i < N; i++) { for (int k = 0; k < 165000; k++) { if (dp[i][k]) { if ((k^a[i]) < 164000) dp[i+1][k ^ a[i]] = true; dp[i+1][k] = true; } } } int ans = 0; for (int i = 0; i < 165000; i++) { if (dp[N][i]) ans++; } cout << ans << endl; return 0; }