#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

ll a[200009],b[200009];
ll n,ans;
int main()
{
    scanf("%lld",&n);
    ll x;
    for(ll i=1;i<=n;i++)
    {
        scanf("%lld",&x);
        b[i]=b[i-1]^x;
        a[i]=a[i-1]+x;
    }
    ll l=1,r=1;
    for(r=1;r<=n;r++)
    {
        while((a[r]-a[l-1])!=(b[r]^b[l-1]))
        {
           l++;
        }
        //l++;
        ans+=(r-l+1);
    }
    printf("%lld\n",ans);
    return 0;
}