include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
using namespace std;
int getNumberOfDistrict(vector<int>& nums) {
unordered_set<int> st;
st.insert(0);
int tmp = 0;
int res = 0;
for(auto num : nums) {
tmp = tmp ^ num;
if(st.find(tmp) == st.end()){
st.insert(tmp);
}else {
unordered_set<int> tmpSet;
tmpSet.insert(0);
tmp = 0;
swap(st, tmpSet);
res++;
}
}
return res;
}
int main() {
int N;
while(cin >> N) {
vector<int> nums(N, 0);
for(int i = 0; i < N; i++) {
cin >> nums[i];
}
cout << getNumberOfDistrict(nums) << endl;
}
return 0;
}