#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int num[N];
long long sum[N];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  unordered_set<long long> unset;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
    sum[i] = sum[i - 1] + 1LL * num[i];
  }
  for (int i = 1; i <= n; i++) {
    int limit = num[i], k = 0;
    while (limit) {
      k++;
      limit >>= 1;
    }
    limit = 1 << k;
    for (int j = i + 2; j <= n; j++) {
      int x = num[i] ^ num[j];
      if (sum[j - 1] - sum[i] == (long long)x) {
        long long sign = 1LL * i * 1000000 + 1LL * j;
        unset.insert(sign);
      }
      if (sum[j - 1] - sum[i] >= limit) break;
    }
  }
  for (int j = n; j >= 1; j--) {
    int limit = num[j], k = 0;
    while (limit) {
      k++;
      limit >>= 1;
    }
    limit = 1 << k;
    for (int i = j - 2; i >= 1; i--) {
      int x = num[i] ^ num[j];
      if (sum[j - 1] - sum[i] == (long long)x) {
        long long sign = 1LL * i * 1000000 + 1LL * j;
        unset.insert(sign);
      }
      if (sum[j - 1] - sum[i] >= limit) break;
    }
  }
  cout << unset.size() << endl;
  return 0;
}
