#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
#define Inf 0x3f3f3f3f3f3f3f3f
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define REP(i, s, t) for (int i = (s), i##ed = (t); i <= i##ed; i ++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
template <typename T> void chkmax(T &x, T y) { x = x > y ? x : y; }
template <typename T> void chkmin(T &x, T y) { x = x < y ? x : y; }
template <typename T> void read(T &x) {
  x = 0; bool w = 0; char ch = 0;
  for (; !isdigit(ch); ch = getchar()) w |= ch == '-';
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  x *= w ? -1 : 1;
}
template <typename T> void write(T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <typename T> void write(T x, char ch) { write(x); putchar(ch); }
template <typename T> void writeln(T x) { write(x); puts(""); }

const int N = 2e5 + 5;
int n;
ll a[N];
ll ans = 0;
int main() {
  read(n);
  for (int i = 1; i <= n; i ++) read(a[i]);
  int l = 1, r = 1, sumx = a[1], sum = a[1];
  for (int i = 1; i <= n; i ++) {
    while ((sumx == sum) && r <= n) {
      ++ r; 
      sum += a[r]; sumx ^= a[r];  
    }
    ans += r - l;
    sumx ^= a[l]; sum -= a[l]; 
    ++ l; 
    if (r < l) r = l;
  }
  writeln(ans);
  return 0; 
}