#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18;
const long long MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const int MAXN = 200050;
long long a[MAXN];
int highbit(long long x) {
  int cnt = 0;
  while (x) {
    cnt++;
    x >>= 1;
  }
  return cnt + 1;
}
map<pair<int, int>, bool> mp;
void solve(int T) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
  }
  int ans = 0;
  for (int l = 1; l <= n; l++) {
    int r = l + 1;
    long long sum = 0, lim = (1ll << (highbit(a[l])));
    while (r < n && sum <= lim) {
      sum += a[r++];
      if (sum == (a[l] ^ a[r])) {
        ans++;
        mp[{l, r}] = 1;
      }
    }
  }
  for (int r = n; r > 0; r--) {
    int l = r - 1;
    long long sum = 0, lim = (1ll << (highbit(a[r])));
    while (l > 1 && sum <= lim) {
      sum += a[l--];
      if (sum == (a[l] ^ a[r]) && mp[{l, r}] == false) {
        ans++;
      }
    }
  }
  printf("%d\n", ans);
}
signed main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve(i);
  }
}
