# include <bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int n,s1[N],s2[N];
int get(int pos)
{
	int l=pos,r=n,ans;
	while (l<=r) {
		int mid=(l+r)>>1;
		if ((s1[mid]-s1[pos-1])==(s2[mid]^s2[pos-1])) ans=mid,l=mid+1;
		else r=mid-1;
	}
	return ans;
}
int main()
{
	while (~scanf("%d",&n)) {
		for (int i=1;i<=n;i++) {
			int x; scanf("%lld",&x);
			s1[i]=s1[i-1]+x;
			s2[i]=s2[i-1]^x;
		}
		int ans=0;
		for (int i=1;i<=n;i++) ans+=get(i)-i+1;
		printf("%d\n",ans);
	}
	return 0;
}