#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#define m(a,b) memset(a,b,sizeof a)
#define en '\n'
using namespace std;
typedef long long ll;
const int N=2e6+5,INF=0x3f3f3f3f;
int a[N];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        for(int i=1;i<=n;i++)
        scanf("%lld",&a[i]);
        int l=1,r=1,tmp=0;ll sum=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)*(r-l+1)/(ll)2;
            tmp^=a[l],l++;
        }
        printf("%lld\n",sum);
    }
}