#include using namespace std; #define PI 4*atan(1) #define INF 1e8 typedef long long ll; int dx[4] = {1,0,-1,0}; int dy[4] = {0,1,0,-1}; int n[17000] = {0}; int N; int dp[5001][17000] = {0}; void dfs(int i, int x, vector A){ if(i == N + 1)return; if(dp[i][x] == 1)return; // n[x^A[i]] = 1; dp[i][x] = 1; n[x] = 1; dfs(i + 1, x^A[i], A); dfs(i + 1, x, A); } int main(){ cin >> N; vector A(N + 1, 0); for(int i = 0; i < N; i++)cin >> A[i]; dfs(0, 0, A); int cnt = 0; for(auto t : n)if(t == 1)cnt++; cout << cnt << endl; }