#include<bits/stdc++.h>
#define mxn 200005
#define LL long long
using namespace std;
int n,L,R;
LL a[mxn],b[mxn],xorv[mxn],ans;
inline int read(){
	int res=0,f_f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f_f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){res=(res<<3)+(res<<1)+ch-'0';ch=getchar();}
	return res*f_f;
}
int main(){
	n=read();
	for (int i=1;i<=n;i++){
		a[i]=read();
		b[i]=b[i-1]+a[i],xorv[i]=xorv[i-1]^a[i];
	}
	L=1,R=1,ans=1;
	while(R<n){
		R++;
		if(b[R]-b[L-1]==(xorv[R]^xorv[L-1])) ans+=(LL)R-L+1;
		else{
			while(b[R]-b[L-1]!=(xorv[R]^xorv[L-1])) L++;
			ans+=(LL)R-L+1;
		}
	}
	printf("%lld\n",ans);
	return 0;
}