#include <bits/stdc++.h>
using namespace std;
inline void updmin(long long &a, long long b) { a > b ? a = b : 0; }
inline void updmax(long long &a, long long b) { a < b ? a = b : 0; }
const long long maxn = 5e5 + 5;
const long long inf = 0x3f3f3f3f;
const long long mod = 998244353;
long long get_inv(long long x) {
  if (x == 1) {
    return 1;
  }
  return (-mod / x * get_inv(mod % x) % mod + mod) % mod;
}
long long n, a[maxn];
set<pair<long long, long long> > st;
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long Cases;
  Cases = 1;
  for (int cas = 1; cas <= Cases; cas++) {
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (long long i = 1; i <= n; i++) {
      long long sum = a[i + 1];
      for (long long j = i + 2; j <= n; j++) {
        if ((a[i] ^ a[j]) == sum) {
          st.insert(make_pair(i, j));
        }
        if (sum > 2 * a[i]) {
          break;
        }
        sum += a[j];
      }
    }
    for (long long i = n; i >= 1; i--) {
      long long sum = a[i - 1];
      for (long long j = i - 2; j >= 1; j--) {
        if ((a[i] ^ a[j]) == sum) {
          st.insert(make_pair(j, i));
        }
        if (sum > 2 * a[i]) {
          break;
        }
        sum += a[j];
      }
    }
    cout << st.size() << "\n";
  }
  return 0;
}
