#include using namespace std; #define vi vector #define pb push_back #define P pair #define PP pair #define fi first #define se second #define INF 1e9 #define MOD 1000000007 #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) bool dp[5001][1<<14+1]; int main(){ int n; cin>>n; vi vec(n); REP(i,n)cin>>vec[i]; dp[0][0]=true; dp[0][vec[0]]=true; REP(i,n){ REP(j,1<<14+1){ if(dp[i][j]){ dp[i+1][j]=true; dp[i+1][j^vec[i]]=true; } } } int ans=0; REP(i,1<<14+1){ ans+=dp[n][i]; } cout<