#include<bits/stdc++.h>
#define LL long long
#define N 200005
using namespace std;
const LL inf=1e9;
LL n,s,a[N];
int main()
{
	scanf("%d",&n);
	{
		for (LL i=1;i<=n;i++) scanf("%d",&a[i]);
		LL ans=0,j=1,x=0,sum=0;
		for (LL i=1;i<=n;i++)
		{
			while (x==sum && j<=n)
			{
				x^=a[j];
				sum+=a[j];
				j++;
			}
			ans+=j-i;
			x^=a[i];
			sum-=a[i];
		}
		printf("%d",ans);
	}
	return 0;
}