#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
using namespace std;
int num[200005];
int ans;
int main(){
	int n;
	scanf("%d" , &n);
	for(int i = 1 ;i <= n ; i++){
		scanf("%d" , &num[i]);
	}
	int next = 1;
	for(int i = 1 ;i <= n ; i = next){
		int done = 0;
		int plu = 0;
//		cout << i;
		while(plu == done){
			
			plu += num[next];
			done ^= num[next];
			if(plu == done)	next++;
			if(next > n)	break;
		//	cout <<"next = " << next << endl;
		}
		ans += (next - i) * (next - i + 1) / 2;
	}
	cout << ans;
	return 0;
}