#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cmath>
#define maxn (200000+500)
#define int long long
using namespace std;
int a[maxn],n,now,ans,l,r;

signed main()
{
	scanf("%lld",&n);
	for (int i=1;i<=n;++i) scanf("%lld",&a[i]);
	for (l=r=1,now=ans=0;r<=n;)
	{
		while ((now^a[r])==(now+a[r]) && r<=n)
			now^=a[r],r++;
		if (r<=n) ans+=r-l;
		else ans+=(r-l)*(r-l+1)/2;
		now^=a[l],l++;
	}
	printf("%lld\n",ans);

	return 0;
}