#include <bits/stdc++.h>
using namespace std;
const int N = 300000;
const long long INF = (1 << 30) - 1;
int n;
long long a[N + 9], sum[N + 9];
void into() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]);
    sum[i] = a[i] + sum[i - 1];
  }
}
int ans;
void Get_ans(int l, int r) {
  if (l <= 0 || r > n) return;
  for (; 2333;) {
    if ((a[l] ^ a[r]) == sum[r - 1] - sum[l]) ++ans;
    int le = 1, ri = n, len = n + 1;
    for (int mid; le <= ri;) {
      mid = le + ri >> 1;
      int nl = l - mid, nr = r + mid;
      if (nl <= 0 || nr > n) {
        len = mid;
        ri = mid - 1;
        continue;
      }
      sum[nr] - sum[nl - 1] - sum[r - 1] + sum[l] >= sum[r - 1] - sum[l]
          ? (len = mid, ri = mid - 1)
          : le = mid + 1;
    }
    l -= len;
    r += len;
    if (l <= 0 || r > n) return;
  }
}
void Get_ans() {
  for (int i = 1; i <= n; ++i) Get_ans(i - 1, i + 1);
  for (int i = 1; i < n; ++i) Get_ans(i - 1, i + 2);
}
void work() { Get_ans(); }
void outo() { printf("%d\n", ans); }
int main() {
  int T = 1;
  for (; T--;) {
    into();
    work();
    outo();
  }
  return 0;
}
