#include<bits/stdc++.h> 
using namespace std;
int i,j,k,a[200005],n,l,r,sum,sum2,sum3;
int main()
{
	cin>>n;sum3=0;
	for(i=1;i<=n;i++) 
	cin>>a[i];
	l=1;r=0;sum=0;
		while(r+1<=n)
		{r++;
		while((sum+a[r])!=(sum^a[r])) 
		{sum=sum^a[l];l++;}
		sum=sum^a[r];//cout<<l<<" "<<r<<"**"<<endl; 
	    sum3=sum3+r-l+1;
		}  
	
	cout<<sum3;
	return 0;}