#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> mp;
int n, a[200005], res;
void solve(bool op) {
  for (int i = 1; i + 2 <= n; i++) {
    long long s = a[i + 1];
    int k = 0;
    for (int j = 0; j <= 29; j++)
      if (a[i] >> j & 1) k = j;
    if (!op) {
      for (int j = i + 2; j <= n; j++) {
        if (s == (a[i] ^ a[j])) res++, mp[make_pair(n - j + 1, n - i + 1)] = 1;
        s += a[j];
        if (s >= (1 << k + 1)) break;
      }
    } else {
      for (int j = i + 2; j <= n; j++) {
        if (s == (a[i] ^ a[j]) && !mp.count(make_pair(i, j))) res++;
        s += a[j];
        if (s >= (1 << k + 1)) break;
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  solve(0);
  reverse(a + 1, a + 1 + n);
  solve(1);
  cout << res << '\n';
  return 0;
}
