#include #include #include using namespace std; int dp[5001][1<<16]; int main(void) { int N; vector A; cin >> N; A.resize(N); for (int i = 0; i < N; i++) cin >> A[i]; dp[0][0] = 1; for (int i = 0; i < N; i++) { for (int j = 0; j <= (1 << 15); j++) { dp[i+1][j] = dp[i][j] || dp[i][j^A[i]]; } } int ans = 0; for (int i = 0; i <= (1 << 15); i++) { ans += dp[N][i]; } cout << ans << endl; return 0; }