#include <bits/stdc++.h>
#define int long long
using namespace std;
const int N=200005;
int sum1[N],sum2[N];
signed main(){
    ios::sync_with_stdio(0);
    int n,t;
    cin>>n>>t;
    sum1[1]=sum2[1]=t;
    for(int i=2;i<=n;i++){
        cin>>t;
        sum1[i]=sum1[i-1]+t;
        sum2[i]=sum2[i-1]^t;
    }
    int l=1,ans=0;
    for(int r=1;r<=n;r++){
        while((sum1[r]-sum1[l-1])!=(sum2[r]^sum2[l-1]))l++;
        ans+=r-l+1;
    }
    cout<<ans<<endl;
    return 0;
}