#include using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) #define FOR(i,b,e) for (int i=(int)(b); i<(int)(e); i++) #define ALL(x) (x).begin(), (x).end() const double PI = acos(-1); bool dp[2][1<<15]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; dp[0][0] = 1; REP (i, n) { int cur = i & 1; int nxt = (i+1) & 1; memset(dp[nxt], 0, sizeof(dp[nxt])); int x; cin >> x; REP (j, 1<<15) { if (dp[cur][j]) { dp[nxt][j] = 1; dp[nxt][j^x] = 1; } } } int ret = 0; REP (i, 1<<15) ret += dp[n&1][i]; cout << ret << endl; return 0; }