#include <bits/stdc++.h>
using namespace std;
const int N = 200009;
int n, a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int ans = 0;
  for (int l = 0; l < n - 2; ++l) {
    int cur = a[l];
    long long topBit = 1LL;
    while (topBit <= cur) {
      topBit <<= 1;
    }
    long long sm = a[l + 1];
    for (int r = l + 2; r < n; ++r) {
      if (sm >= topBit) {
        break;
      }
      if ((a[r] ^ a[l]) == sm) {
        ans++;
      }
      sm += a[r];
    }
  }
  reverse(a, a + n);
  for (int l = 0; l < n - 2; ++l) {
    int cur = a[l];
    long long topBit = 1LL;
    while (topBit <= cur) {
      topBit <<= 1;
    }
    long long sm = a[l + 1];
    for (int r = l + 2; r < n; ++r) {
      if (sm >= topBit) {
        break;
      }
      if ((a[r] ^ a[l]) == sm && __builtin_clz(a[l]) != __builtin_clz(a[r])) {
        ans++;
      }
      sm += a[r];
    }
  }
  cout << ans << '\n';
  return 0;
}
