#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
using namespace std;
unsigned long long getHighestPower(int a) {
  for (int(j) = (29); (j) >= (0); (j)--) {
    if ((a >> j)) return 2LL << j;
  }
  return 1LL;
}
int main() {
  int n;
  cin >> n;
  int a[n], ans = 0;
  set<pair<int, int>> done;
  for (int(i) = (0); (i) <= (n - 1); (i)++) cin >> a[i];
  for (int(l) = (0); (l) <= (n - 1); (l)++) {
    unsigned long long k = getHighestPower(a[l]), sum = 0;
    for (int(r) = (l + 2); (r) <= (n - 1); (r)++) {
      sum += a[r - 1];
      if (sum >= k) break;
      if ((a[l] ^ a[r]) == sum) {
        ++ans;
        done.emplace(l, r);
      }
    }
  }
  for (int(r) = (n - 1); (r) >= (0); (r)--) {
    unsigned long long k = getHighestPower(a[r]), sum = 0;
    for (int(l) = (r - 2); (l) >= (0); (l)--) {
      sum += a[l + 1];
      if (sum >= k or done.count({l, r})) break;
      if ((a[r] ^ a[l]) == sum) ++ans;
    }
  }
  cout << ans;
  return 0;
}
