using namespace std;
int h[200005],yh[200005];
int ans;
int main() {    
	int n,x;    
	scanf("%d",&n);    
	h[0]=0;
	yh[0]=0;    
	for(int i=1;i<=n;i++)    
	{        
		scanf("%d",&x);        
		h[i]=h[i-1]+x;        
		yh[i]=yh[i-1]^x;    
	}    
	int l=1;    
	ans=0;    
	for(int r=1;r<=n;r++)    
	{        
		while((h[r]-h[l-1])!=(yh[r]^yh[l-1])) l++;        
		ans+=r-l+1;    
	}    
	printf("%d\n",ans);
}
