#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265359;
long long inf = 1000000000000000007;
long long mod = 1000000007;
long long mod1 = 998244353;
const bool multi = 0;
long long a[200007];
long long pref[200007];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  if (multi)
    cin >> tt;
  else
    tt = 1;
  while (tt--) {
    long long n, ans = 0;
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> a[i];
    set<pair<long long, long long>> S;
    S.insert({-inf, 0});
    for (long long i = 1; i <= n; i++) {
      pref[i] = pref[i - 1] + a[i];
      set<pair<long long, long long>>::iterator it = --S.end();
      while (true) {
        pair<long long, long long> p = *it;
        if (p.first < pref[i - 1] - a[i]) break;
        if (p.second < i - 1 &&
            pref[i - 1] - pref[p.second] == (a[i] ^ a[p.second]))
          ans++;
        it--;
      }
      S.insert({a[i] + pref[i], i});
    }
    cout << ans;
  }
  return 0;
}
