#include <bits/stdc++.h>

using namespace std;

bool isSol(vector<int>& a)
{
    int b=a[0], c=0;
    for(auto& x : a) b = b & x, c = c ^ x;
    return b>0 && c>0;
}

int main()
{
    ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
    int n; cin >> n;
    vector<int> vec;
    int br; while(n--) cin >> br, vec.push_back(br);
    int sol = 0; for(auto& x : vec) if(!x) sol++;
    int Xor = 0; for(auto& x : vec) Xor = Xor^x;
    if(!Xor) sol++;
    int And = vec[0]; for(auto& x : vec) And = And&x;
    if(!And) sol++;
    cout << sol << endl;
    return 0;
}