#include <bits/stdc++.h>
using namespace std;
long long t, n, m, k, a[300010], q, l, r;
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  long long res = 0;
  for (long long l = 1; l <= n; l++) {
    long long b = 0;
    long long x = a[l];
    while (x > 1) {
      x /= 2;
      b++;
    }
    long long sum = a[l + 1];
    for (long long r = l + 2; (r <= n) && (sum <= ((1ll << (b + 1)))); r++) {
      if (((a[r] ^ a[l]) == sum) && (a[r] <= a[l])) {
        res++;
      }
      sum += a[r];
    }
  }
  for (long long r = 1; r <= n; r++) {
    long long b = 0;
    long long x = a[r];
    while (x > 1) {
      x /= 2;
      b++;
    }
    long long sum = a[r - 1];
    for (long long l = r - 2; (l >= 1) && (sum <= ((1ll << (b + 1)))); l--) {
      if (((a[r] ^ a[l]) == sum) && (a[l] < a[r])) {
        res++;
      }
      sum += a[l];
    }
  }
  cout << res;
  return 0;
}
