#include<iostream>
using namespace std;
int a[100007];
int n;
int main(){
	scanf("%d",&n);
	for (int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	int l=0,r=1;
	int ans=0;
	int hh=a[0];
//	cout<<(2 & 5)<<endl;
	while (l!=n){
		while (r!=n){
			if ((hh ^ a[r])!=hh+a[r]){
				break;
			}
			hh+=a[r];
			r++;
		}
		ans+=r-l;
		//cout<<l<<' '<<ans<<endl;
		hh-=a[l];
		l++;
	}
	printf("%d\n",ans);
	return 0;
}