#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
long long n;
long long a[N];
void scan() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
}
long long pref[N];
void prepare() {
  for (long long i = 0; i < n; ++i) {
    pref[i + 1] = pref[i] + a[i];
  }
}
bool check(long long l, long long r) {
  return r - 1 >= l + 1 && (a[l] ^ a[r]) == pref[r] - pref[l + 1];
}
void solve() {
  set<pair<long long, long long>> f;
  long long d = 0;
  long long ans = 0;
  for (long long r = 0; r < n; ++r) {
    for (auto e : f) {
      if (a[r] < e.first + d) {
        break;
      }
      ans += check(e.second, r);
    }
    d += a[r];
    f.insert({-a[r] - d, r});
  }
  cout << ans << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  scan();
  prepare();
  solve();
  return 0;
}
