#include <bits/stdc++.h>
using namespace std;
const int N = (int)2e5 + 50;
int n, a[N];
int h[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    for (int b = 0; b < (30); ++b)
      if (a[i] >> b & 1) h[i] = b;
  }
  int res = 0;
  for (int l = 0; l < (n - 1); ++l) {
    long long csum = a[l + 1];
    int r = l + 2;
    while (r < n && csum < (1LL << (h[l] + 1))) {
      if (csum == (a[l] ^ a[r]) && a[l] >= a[r]) res++;
      csum += a[r];
      r++;
    }
  }
  for (int r = n - 1; r >= 1; r--) {
    long long csum = a[r - 1];
    int l = r - 2;
    while (l >= 0 && csum < (1LL << (h[r] + 1))) {
      if (csum == (a[l] ^ a[r]) && a[r] > a[l]) res++;
      csum += a[l];
      l--;
    }
  }
  cout << res << '\n';
}
