#include <bits/stdc++.h>
int n;
long long a[200010], ans, limit[200010], sum;
struct pir {
  int fir, sec;
  friend bool operator<(pir x, pir y) {
    return x.fir == y.fir ? x.sec < y.sec : x.fir < y.fir;
  }
};
std::map<pir, bool> memory;
inline void Process() {
  for (int l = 1; l + 2 <= n; l++) {
    sum = a[l + 1];
    for (int r = l + 2; r <= n; r++) {
      if (sum == (a[l] ^ a[r])) {
        ans++;
        memory[(pir){l, r}] = true;
      }
      sum += a[r];
      if (sum > limit[l]) {
        break;
      }
    }
  }
  for (int r = n; r - 2 >= 1; r--) {
    sum = a[r - 1];
    for (int l = r - 2; l >= 1; l--) {
      if (sum == (a[l] ^ a[r])) {
        ans += !memory[(pir){l, r}];
      }
      sum += a[l];
      if (sum > limit[r]) {
        break;
      }
    }
  }
}
inline void Gather() {
  long long tmp;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", a + i);
    tmp = a[i];
    while (tmp) {
      limit[i]++;
      tmp >>= 1;
    }
    limit[i] = 1 << limit[i];
  }
}
inline void Release() { printf("%lld\n", ans); }
int main(int argc, char *argv[]) {
  Gather();
  Process();
  Release();
  return 0;
}
