#include <bits/stdc++.h>
#pragma GCC optimize(4)
using namespace std;
char _buf[100000], *_p1 = _buf, *_p2 = _buf;
inline int gi() {
  int x = 0, f = 1;
  char ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                            _p1 == _p2)
                 ? EOF
                 : *_p1++);
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                         _p1 == _p2)
              ? EOF
              : *_p1++);
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = (_p1 == _p2 && (_p2 = (_p1 = _buf) + fread(_buf, 1, 100000, stdin),
                         _p1 == _p2)
              ? EOF
              : *_p1++);
  }
  return (f == 1) ? x : -x;
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
const int maxn = 2e5 + 5;
set<pair<int, int> > s;
int n, a[maxn], ans;
inline void init() {}
inline void input() {
  n = gi();
  for (int i = 1; i <= n; ++i) a[i] = gi();
}
inline void solve() {
  for (int i = 1; i <= n; ++i) {
    int sum = 0;
    for (int j = i + 2; j <= n; ++j) {
      sum += a[j - 1];
      if (sum == (a[i] ^ a[j])) ans++, s.insert(pair<int, int>(i, j));
      if (sum > a[i] * 2) break;
    }
  }
  reverse(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    int sum = 0;
    for (int j = i + 2; j <= n; ++j) {
      sum += a[j - 1];
      if (sum == (a[i] ^ a[j]))
        if (!s.count(pair<int, int>(n - j + 1, n - i + 1))) ans++;
      if (sum > a[i] * 2) break;
    }
  }
  printf("%d\n", ans);
}
int main() {
  init();
  input();
  solve();
  return 0;
}
