#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <iterator>
#include <set>
#include <cmath>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long LL;
const int maxn = 2020000;
const LL INF = 100000000000000LL;
const LL mod = 1e9 + 9;
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define For(i,a,b) for(int i=a;i<=b;++i)

int a[maxn];
int vis[maxn] = {0};

int dfs(int x, int rt) {
	if(x&(1<<rt)) {
		if(vis[rt]) return 0;
		else {
			vis[rt] = 1;
			if(dfs(x, rt + 1)) return 1;
			vis[rt] = 0;
			return 0;
		}
	}
	else return dfs(x, rt + 1);
}


void solve() {
	int n;
	int ans = 0;
	int temp = 0;
	cin >> n;
	for(int i = 1;i <= n;i++) scanf("%d", &a[i]);
	for(int l = 1, r = 0;l <= n;l++) {
		ans += r - l + 1;
		for(int j = r + 1;j <= n;j++) {
			if((temp^a[j]) == temp + a[j]) {
				temp ^= a[j];
				ans++;
				r++;
			}
			else break;
		}
		temp ^= a[l];
	}
	cout << ans << endl;
}

int main() {
	int t = 1;
	while(t--) {
		solve();
	}
	int mark_EOF;
	if(scanf("%d", &mark_EOF) == EOF) return 0;
    return 0;
}
