#include<bits/stdc++.h>
using namespace std;
const int maxn = 200005;
long long f[maxn], s[maxn];
long long ans;
 
int main(){
    int n, x; cin >> n;
    for(int i = 1; i <= n; i++){
        scanf("%d", &x);
        f[i] = f[i-1] + x;   
        s[i] = s[i-1] ^ x;   
    }
    int l = 1;
    ans=0;
    for(int r = 1; r <= n; r++){         
        for(; f[r] - f[l-1] != (s[r] ^ s[l-1]); l++);
        ans += r - l + 1;
    }
    printf("%lld\n", ans);
    return 0;
}
