#include <cmath> #include <cstdio> #include <vector> #include <bits/stdc++.h> using namespace std; #define mkp make_pair typedef long long ll; map <pair <ll, pair <ll, ll> >, ll > mp; typedef pair <ll, pair <ll, ll> > pii; ll ar[50]; ll n; ll f (ll idx, int sum, int xr) { if (idx == n) { if ((sum ^ xr) == 0) return 1; return 0; } pii tmp = mkp(idx, mkp(sum,xr) ); if (mp.find(tmp) != mp.end()) return mp[tmp]; ll ans = 0; ans += f(idx+1, sum + ar[idx], xr); ans += f(idx+1, ar[idx], sum ^ xr); mp[tmp] = ans; return ans; } int main() { /* Enter your code here. Read input from STDIN. Prll output to STDOUT */ scanf ("%lld", &n); for (ll i = 0; i < n; i++) scanf ("%lld", &ar[i]); cout <<f(0,0,0)/2<<endl;; return 0; }