#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(32769, false)); dp[0][0] = true; int a; rep(i,1,N+1){ cin >> a; rep(j,0,32769){ if(dp[i-1][j]){ dp[i][j] = true; dp[i][a^j] = true; } } } cout << accumulate(dp[N].begin(), dp[N].end(), 0) << endl; }