#include <bits/stdc++.h>
using namespace std;
const string yno[2] = {"NO\n", "YES\n"};
int n, a[200005], mx[200005];
int cal(int t) {
  int ans = 0;
  ans = 1;
  while (t) {
    t >>= 1;
    ans <<= 1;
  }
  return ans;
}
void process() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    int t = cal(a[i]), s = 0;
    for (int j = i + 2; j <= n; j++) {
      s += a[j - 1];
      if (s > t) break;
      mx[i] = j;
      if ((a[i] ^ a[j]) == s) ans++;
    }
  }
  for (int i = 1; i <= n; i++) {
    int t = cal(a[i]), s = 0;
    for (int j = i - 2; j >= 1; j--) {
      s += a[j + 1];
      if (s > t) break;
      if ((a[i] ^ a[j]) == s && i > mx[j]) ans++;
    }
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  process();
  return 0;
}
