#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const long long mod = 998244353;
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int a[200005], n, m, tot;
set<pair<int, int> > Q;
int main() {
  int i, j, k;
  n = read();
  for (i = 1; i <= n; i++) a[i] = read();
  for (i = 1; i <= n; i++) {
    for (j = 30; j >= 0; j--)
      if (a[i] & (1 << j)) break;
    int sum = 0;
    for (k = i - 1; k >= 2; k--) {
      sum += a[k];
      if (sum == (a[i] ^ a[k - 1])) Q.insert({k - 1, i});
      if (sum >= (1 << (j + 1))) break;
    }
  }
  reverse(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    for (j = 30; j >= 0; j--)
      if (a[i] & (1 << j)) break;
    int sum = 0;
    for (k = i - 1; k >= 2; k--) {
      sum += a[k];
      if (sum == (a[i] ^ a[k - 1])) Q.insert({n - i + 1, n - k + 2});
      if (sum >= (1 << (j + 1))) break;
    }
  }
  printf("%d\n", Q.size());
}
