#include <bits/stdc++.h>
const int MAXN = 2e5 + 5;
int n, a[MAXN];
long long sm[MAXN];
int ans = 0;
int pc[MAXN];
inline bool check(int l, int r) { return (a[l] ^ a[r]) == sm[r - 1] - sm[l]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i), sm[i] = sm[i - 1] + a[i];
  for (int i = 1; i <= n; ++i) {
    int x = a[i];
    while (x) x >>= 1, ++pc[i];
  }
  for (int l = 1; l <= n - 2; ++l) {
    int r = l + 2;
    while (r <= n && sm[r - 1] - sm[l] < (1ll << pc[l])) {
      if (pc[l] >= pc[r]) ans += check(l, r);
      ++r;
    }
  }
  std::reverse(a + 1, a + n + 1);
  std::reverse(pc + 1, pc + n + 1);
  for (int i = 1; i <= n; ++i) sm[i] = sm[i - 1] + a[i];
  for (int l = 1; l <= n - 2; ++l) {
    int r = l + 2;
    while (r <= n && sm[r - 1] - sm[l] < (1ll << pc[l])) {
      if (pc[l] > pc[r]) ans += check(l, r);
      ++r;
    }
  }
  printf("%d\n", ans);
  return 0;
}
