#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define SF scanf
#define PF printf
#define REP(i,a,b) for(int i = (a);i <= (b);i++)
#define N 200100
int n,sum[N],a[N];
using namespace std;
long long ans = 0ll;
int main()
{
	cin>>n;
	REP(i,1,n)
		SF("%d",&a[i]);
	int r = 1;
	int xx = a[1], ss = a[1];
	REP(i,1,n){
		while(xx == ss && r <= n){
			r++;
			xx ^= a[r], ss += a[r];
		}
		ans += r - i;
		xx ^= a[i], ss -= a[i];
	}
	cout<<ans<<endl;
	return 0;
}