#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <iostream>
#include <set>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;

const int INF = 2139062143;

#define DEBUG(x) std::cerr << #x << " = " << x << std::endl

inline ll read() {
    ll f = 1, x = 0;char ch;
    do {ch = getchar();if (ch == '-')f = -1;} while (ch > '9' || ch < '0');
    do {x = x * 10 + ch - '0';ch = getchar();} while (ch >= '0' && ch <= '9');
    return f * x;
}

const int MAX_N = 2 * 1e5 + 7;

int n, ans, a[MAX_N], s1[MAX_N], s2[MAX_N];

int main() {
	n = read ();
	for (int i = 1; i <= n; i ++ ) a[i] = read (), s1[i] = s1[i] + a[i], s2[i] = s2[i] ^ a[i];
	int l = 1;
	for (int r = 1; r <= n; r ++ ) {
		while (s1[r] - s1[l - 1] != s2[r] ^ s2[l - 1]) l ++ ;
		ans += r - l + 1;
	}
	cout << ans << endl;
	return 0;
}

