#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n;
long long a[maxn], sum[maxn];
map<pair<long long, long long>, bool> mp;
long long read() {
  long long s = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * f;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read(), sum[i] = sum[i - 1] + a[i];
  int ans = 0;
  for (int i = 1; i <= n - 2; ++i) {
    int k;
    for (int j = 30; j >= 0; --j) {
      if ((a[i] >> j) & 1) {
        k = j;
        break;
      }
    }
    for (int j = i + 2; j <= n; ++j) {
      if (sum[j - 1] - sum[i] >= (1 << (k + 1))) break;
      if (sum[j - 1] - sum[i] == (a[i] ^ a[j])) {
        ++ans;
        mp[make_pair(i, j)] = true;
      }
    }
  }
  for (int i = n; i >= 3; --i) {
    int k;
    for (int j = 30; j >= 0; --j) {
      if ((a[i] >> j) & 1) {
        k = j;
        break;
      }
    }
    for (int j = i - 2; j >= 1; --j) {
      if (sum[i - 1] - sum[j] >= (1 << (k + 1))) break;
      if (sum[i - 1] - sum[j] == (a[i] ^ a[j]) &&
          (mp.find(make_pair(j, i)) == mp.end())) {
        ++ans;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
