#include<bits/stdc++.h>
#define ll long long
#define il inline
#define re register
using namespace std;
ll n,a[10500];
il ll read()
{
    re ll x=0,f=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
    while(c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
    return x*f;
}
int main(){
	n=read();
	for(ll i=1;i<=n;i++){
		a[i]=read();
	}
	ll l=1,r=1,sum=0,tmp=0;
while(r<=n)
    {
        while((a[r]^tmp)==(a[r]+tmp)&&r<=n)
            tmp^=a[r],r++;
        if(r!=n+1)
            sum+=r-l;
        else
            sum+=(ll)(r-l)*(ll)(r-l+1)/(ll)2;
        tmp^=a[l],l++;
    }
    cout<<sum;
	//cout<<n;
	return 0;
}