#include <bits/stdc++.h>
using namespace std;
const int N=300000;
int a[N],n;
int main()
{
	scanf("%d",&n);
	int num=0;
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i++)
	{
		int j=i,tmp=a[i],sum=a[i];
		while(j<=n&&tmp==sum) tmp=tmp^a[++j],sum+=a[j];
		num+=j-i;
//		printf("%d %d/",i,j);
	}
	cout<<num<<endl; 
	return 0;
}