#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
template <class T>
void read(T &val) {
  T x = 0;
  T bz = 1;
  char c;
  for (c = getchar(); (c < '0' || c > '9') && c != '-'; c = getchar())
    ;
  if (c == '-') {
    bz = -1;
    c = getchar();
  }
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - 48;
  val = x * bz;
}
const int mod = 998244353;
const int maxn = 1e6 + 10;
int n, m, a[maxn], q, t;
char s[maxn];
long long sum[maxn];
map<pair<int, int>, int> mpp;
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]), sum[i] = sum[i - 1] + a[i];
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 2; j <= n; j++) {
      if (sum[j - 1] - sum[i] > 2 * a[i]) break;
      if (sum[j - 1] - sum[i] == (a[i] ^ a[j])) ans++, mpp[{i, j}] = 1;
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = i - 2; j >= 1; j--) {
      if (sum[i - 1] - sum[j] > 2 * a[i]) break;
      if (sum[i - 1] - sum[j] == (a[i] ^ a[j])) {
        if (!mpp.count({j, i})) ans++;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
