#include <bits/stdc++.h>
using namespace std;
#define N 200000
int n,tot;
int l,r;
int a[N+1];
int x[N+1];
int s[N+1];
int main(int argc,char *argv[]){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		s[i]=s[i-1]+a[i];
		x[i]=x[i-1]^a[i];
	}
	int r=1;
	for(int i=1;i<=n;i++){
		r=max(r,i);
		while(s[r+1]-s[i-1]==x[r+1]-x[i-1] && r+1<=n)	r++;
		tot+=r-i+1;
	}
	printf("%d",tot);
	return 0;
}