/* Never Run, Never Stop, Only Walk */ #include <bits/stdc++.h> using namespace std; #define _CRT_SECURE_NO_DEPRECATE //suppress some compilation warning messages // Shortcuts for "common" data types in contests typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef set<int> si; typedef map<string, int> msi; //Input Output #define ci(t) scanf("%d", &t) #define cli(t) scanf("%lld", &t) // To simplify repetitions/loops, Note: define your loop style and stick with it! #define REP(i, a, b) \ for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local! #define TRvi(c, it) \ for (vi::iterator it = (c).begin(); it != (c).end(); it++) #define TRvii(c, it) \ for (vii::iterator it = (c).begin(); it != (c).end(); it++) #define TRmsi(c, it) \ for (msi::iterator it = (c).begin(); it != (c).end(); it++) #define INF 2000000000 // 2 billion // If you need to recall how to use memset: #define MEMSET_INF 127 // about 2B #define MEMSET_HALF_INF 63 // about 1B //memset(dist, MEMSET_INF, sizeof dist); // useful to initialize shortest path distances //memset(dp_memo, -1, sizeof dp_memo); // useful to initialize DP memoization table //memset(arr, 0, sizeof arr); // useful to clear array of integers //To simplify frequently use things #define pb push_back #define mkp make_pair #define get getchar inline int scan() { int n=0,s=1; char p=get(); if(p=='-') s=-1; while((p<'0'||p>'9')&&p!=EOF&&p!='-') p=get(); if(p=='-') s=-1,p=get(); while(p>='0'&&p<='9') { n = (n<< 3) + (n<< 1) + (p - '0'); p=get(); } return n*s; } /* void print(int X) { if(X<0) { putchar_unlocked('-'); X=-X; } int Len=0,Data[10]; while(X) { Data[Len++]=X%10; X/=10; } if(!Len) Data[Len++]=0; while(Len--) putchar_unlocked(Data[Len]+48); }*/ ll n; ll arr[50]; map<pair<ll, ll >, ll>m; ll rec(ll pos, ll xori) { if(pos == n) { return (xori == 0); } if(m.find(make_pair(pos, xori)) != m.end()) { return m[make_pair(pos, xori)]; } ll ans = 0; ll sum = 0; for(ll i = pos; i < n; i++) { sum += arr[i]; ans += rec(i + 1, sum ^ xori); } return m[make_pair(pos, xori)] = ans; } void solve() { m.clear(); cli(n); for(ll i = 0; i < n; i++) { scanf("%lld", &arr[i]); } ll ans = rec(0, 0); printf("%lld\n", ans); } int main() { //ios_base::sync_with_stdio(false); //cin.tie(NULL); int t = 1; //scanf("%d", &t); while(t--) { solve(); } return 0; }