#include <bits/stdc++.h> using namespace std; typedef long long LL; typedef unsigned long long ULL; typedef vector<int> VI; typedef vector<LL> VLL; typedef pair<int, int> PI; #define SI(x) scanf("%d", &x) #define SLL(x) scanf("%lld", &x) #define SORTV(v) sort(v.begin(), v.end()) #define EACH(it, v) for(__typeof(v.begin()) it(v.begin()); it != v.end(); it++) #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define f first #define s second template<class T> void print_array(T a[], int size) { for(int i=0; i<size; i++) cout<<a[i]<<" "; cout<<endl; } template<class T> void print_array_v(T &a) { int size = a.size(); for(int i=0; i<size; i++) cout<<a[i]<<" "; cout<<endl; } map<pair<int, int>, LL> s[2]; int main() { /* int T; scanf("%d", &T); while(T--) { } */ int n; SI(n); int a[50]; for(int i=0; i<n; i++) SI(a[i]); LL ans = 0; s[0][mp(a[0], a[0])] = 1; for(int i=1; i<n; i++) { int ind = i%2, oth = !ind; s[ind].clear(); EACH(it, s[oth]) { s[ind][mp(it->f.f + a[i], it->f.s^it->f.f^(it->f.f + a[i]))] += it->s; s[ind][mp(a[i], it->f.s^a[i])] += it->s; } // EACH(it, s[ind]) // cout<<it->f.f<<" "<<it->f.s<<" "<<it->s<<endl; // cout<<endl; } int ind = !(n%2); EACH(it, s[ind]) if(it->f.s == 0) ans += it->s; cout<<ans<<endl; return 0; }