#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
using namespace std;


const int maxn = 1000010;
#define ll long long
int a[maxn];
int n;
ll ans = 0ll;
int main()
{
	cin >> n;
	for (int i = 1; i <= n;i++)
	{
		cin >> a[i];
	}
	ll sum = 0ll;
	ll xo = 0ll;
	int l = 1;
	int r = 0;
	ll cnt = 0;
	while (1)
	{
		while (r < n && sum + a[r + 1] == (xo ^ a[r + 1]))
		{
			r++;
			sum += a[r];
			xo ^= a[r];
		}
		cnt = r - l + 1;
		ans += cnt;
		sum -= a[l];
		xo ^= a[l++];
		if (l == n + 1)
		{
			break;
		}
	}
	cout << ans << endl;
	return 0;
}