#include <bits/stdc++.h>
using namespace std;
bool putSpace = true;
bool newLine = false;
bool newLineA = false;
bool pairEndLine = false;
template <class T>
istream& operator>>(istream& in, vector<T>& v) {
  for (auto& i : v) {
    in >> i;
  }
  return in;
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  for (auto i : v) {
    out << i;
    if (!newLine) {
      if (putSpace) {
        out << ' ';
      }
    } else {
      out << '\n';
    }
  }
  if (!newLine && newLineA) {
    out << '\n';
  }
  return out;
}
template <class T, class U>
istream& operator>>(istream& in, pair<T, U>& p) {
  in >> p.first >> p.second;
  return in;
}
template <class T, class U>
ostream& operator<<(ostream& out, const pair<T, U>& p) {
  out << p.first << ' ' << p.second;
  if (pairEndLine) {
    cout << '\n';
  }
  return out;
}
long long gettime() {
  return chrono::high_resolution_clock::now().time_since_epoch().count() /
         (long long)1000000;
}
mt19937 rnd(239);
mt19937_64 rnd_64(239);
long long randnum(long long l, long long r) {
  return l + rnd_64() % (r - l + 1);
}
long long sum(const vector<long long>& pref, int l, int r) {
  return pref[r] - ((l == 0) ? 0 : pref[l - 1]);
}
signed main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  vector<long long> pref(n);
  for (int i = 0; i < (n); i++) pref[i] = pref[max(0, i - 1)] + a[i];
  set<pair<long long, int>> s;
  int ans = 0;
  for (int i = 0; i < (n); i++) {
    s.insert(make_pair(a[i] + pref[i], i));
    if (i) {
      auto it = s.lower_bound(make_pair(pref[i - 1] - a[i], -1));
      while (it != s.end()) {
        if (it->second <= i - 2) {
          ans += (sum(pref, it->second + 1, i - 1) == (a[it->second] ^ a[i]));
        }
        it++;
      }
    }
  }
  cout << ans;
  return 0;
}
