#include<stdio.h>

int main()
{
	int bin[200000], num, i, k, xor = 0;
	long sum = 0;
	scanf("%d",&num);
	sum += num;
	for(i = 0; i < num; ++i)scanf("%d",&bin[i]);
	for(i = 0; i < num; ++i){
		xor = 0;
		for(k = 1; k < num - i; ++k){
			xor ^= bin[i+k-1];
			if(!(xor & bin[i+k]))++sum;
			else break;
		}
	}
	printf("%ld",sum);
	return 0;
}