#include <bits/stdc++.h>
using namespace std;
const int mod = 2e5 + 5;
int n;
long long a[200005];
unordered_set<long long> st;
long long cal(long long x) {
  for (long long i = 1LL << 30; i; i >>= 1) {
    if (i & x) return i << 1;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int l = 1; l <= n - 2; ++l) {
    long long mmax = cal(a[l]);
    long long sum = a[l + 1];
    for (int r = l + 2; r <= n; ++r) {
      if ((a[l] ^ a[r]) == sum) st.insert((long long)l * mod + r);
      sum += a[r];
      if (sum > mmax) break;
    }
  }
  for (int r = n; r >= 3; --r) {
    long long mmax = cal(a[r]);
    long long sum = a[r - 1];
    for (int l = r - 2; l >= 1; --l) {
      if ((a[l] ^ a[r]) == sum) st.insert((long long)l * mod + r);
      sum += a[l];
      if (sum > mmax) break;
    }
  }
  cout << st.size() << "\n";
  return 0;
}
