#include #define rep(i,a,b) for(int i=a;i=b;i--) using namespace std; typedef long long ll; typedef pair P; ll INF = 1e18; int main(){ int N; cin >> N; vector > dp(N+1, vector(18001, 0)); dp[0][0] = 1; int a; rep(i,1,N+1){ cin >> a; int cnt = 0; rep(j,0,18001){ if(dp[i-1][j] == 1){ cnt ++; dp[i][j] = 1; int new_num = j ^ a; dp[i][new_num] = 1; if(cnt==i) break; } } } cout << accumulate(dp[N].begin(), dp[N].end(), 0) << endl; }