#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long mod = 998244353;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int INFi = 0x7f7f7f7f;
const long long LEVEL = log2(N) + 1;
long long n, a[N];
void solve() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  set<pair<long long, long long> > ans;
  for (int i = 1; i <= n; i++) {
    long long cur = 0;
    for (int j = i + 1; j < n; j++) {
      if ((long long)log2(a[i]) < (long long)log2(cur)) break;
      cur += a[j];
      if ((a[i] ^ a[j + 1]) == cur) ans.insert({i, j + 1});
    }
  }
  for (int i = n; i >= 1; i--) {
    long long cur = 0;
    for (int j = i - 1; j > 1; j--) {
      if ((long long)log2(a[i]) < (long long)log2(cur)) break;
      cur += a[j];
      if ((a[i] ^ a[j - 1]) == cur) ans.insert({j - 1, i});
    }
  }
  cout << ans.size() << "\n";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed;
  cout << setprecision(15);
  ;
  int test = 1;
  for (int i = 1; i <= test; i++) {
    solve();
  }
}
