#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  set<pair<long long, long long>> ans;
  for (long long t = 0; t < 2; t++) {
    for (long long i = 0; i < n; i++) {
      long long ac = 0;
      long long lg = 63 - __builtin_clzll(v[i]);
      long long limit = (1ll << lg) << 1ll;
      for (long long j = i + 1; j < n - 1; j++) {
        ac += v[j];
        if (ac >= limit) break;
        if ((v[j + 1] ^ v[i]) == ac) {
          if (t == 0) {
            ans.insert({i, j + 1});
          } else {
            ans.insert({n - 1 - (j + 1), n - 1 - i});
          }
        }
      }
    }
    reverse(v.begin(), v.end());
  }
  cout << ans.size() << "\n";
  return 0;
}
