#include <bits/stdc++.h>
#pragma GCC target("sse4.2")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long mod = int(1e9) + 7;
const int INF = 1e9;
const long long LINF = 2e18;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << setprecision(18) << fixed;
  int n;
  cin >> n;
  vector<long long> a(n);
  for (auto& x : a) cin >> x;
  set<pair<int, int>> res;
  for (int i = 0; i < n; i++) {
    long long csum = 0;
    for (int j = i + 2; j < n; j++) {
      csum += a[j - 1];
      if (csum >= 2 * a[i]) break;
      if (csum == (a[i] ^ a[j])) res.emplace(min(i, j), max(i, j));
    }
    csum = 0;
    for (int j = i - 2; j >= 0; j--) {
      csum += a[j + 1];
      if (csum >= 2 * a[i]) break;
      if (csum == (a[i] ^ a[j])) res.emplace(min(i, j), max(i, j));
    }
  }
  cout << (int)(res).size();
  return 0;
}
