#include #include #include #include #include #define rep(i,n) for(int i=0;i=0;i--) #define RREP(i,n) for(int i=n;i>=0;i--) #define scan(x) cin >> x #define print(x) cout << x << endl #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } using namespace std; typedef long long ll; /* Coding Space */ int max_num; int N; int A[5001]; bool** dp; int main(void) { fastcin; scan(N); SREP(n, 1, N) scan(A[n]); REP(n, 14) max_num += 1 << n; dp = new bool*[N + 1]; REP(n, N) { REP(m, N) dp[n][m] = new bool[max_num]; } dp[0][0] = true; SREP(n, 1, N) rep(a, max_num) { if (!dp[n - 1][a]) continue; dp[n][a] = true; dp[n][a ^ A[n]] = true; } print(count(dp[N], dp[N] + max_num, true)); return 0; }