#include typedef long long ll; using namespace std; int INF = 1e9; int MOD = 1e9+7; bool dp[5001][32769]; main(){ int N,A[5000]; cin >> 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 <= 16384*2;j++){ if(dp[i][j]){ dp[i+1][j^A[i]] = 1; dp[i+1][j] = 1; } } } int cnt = 0; for(int i = 0;i <= 16384*2;i++)cnt += dp[N][i]; cout << cnt << endl; }