#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  vector<long long> ps(n + 1);
  set<pair<long long, int>> q;
  ps[0] = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ps[i + 1] = ps[i] + a[i];
    for (const auto &p : q) {
      if (i - p.second < 2) continue;
      if (-p.first < ps[i] - a[i]) break;
      if ((a[i] ^ a[p.second]) == ps[i] - ps[p.second + 1]) ans++;
    }
    q.insert({-(ps[i + 1] + a[i]), i});
  }
  cout << ans;
  return 0;
}
