#include <bits/stdc++.h>
using namespace std;
auto SEED = chrono::steady_clock::now().time_since_epoch().count();
mt19937 rng(SEED);
const int mod = 1e9 + 7, x = 864197532, N = 300087, logN = 18, K = 500,
          C = 1 << 20;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int ans = 0;
  int n;
  cin >> n;
  vector<long long int> a(n), pre(n + 1, 0);
  for (int i = (0); i < (n); i++) cin >> a[i], pre[i + 1] = pre[i] + a[i];
  set<pair<long long int, int>> s;
  for (int i = (2); i < (n + 1); i++) s.insert({pre[i] - pre[i - 1] * 2, i});
  for (int i = (0); i < (n); i++) {
    if (i + 2 <= n) {
      s.erase({pre[i + 2] - pre[i + 1] * 2, i + 2});
    }
    for (auto it = s.lower_bound({pre[i] - pre[i + 1] * 2, -1}); it != s.end();
         ++it) {
      long long int v;
      int j;
      tie(v, j) = *it;
      if ((a[i] ^ a[j - 1]) == pre[j - 1] - pre[i + 1]) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
