#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10, mod = 1e9 + 7, INF = 0x3f3f3f3f;
int a[maxn];
set<pair<int, int> > st;
void cal(int n, int f = 0) {
  for (int i = 1; i <= n; ++i) {
    long long k = a[i], sum = 0;
    while (k != (k & -k)) k -= k & -k;
    k <<= 1;
    for (int j = i + 2; j <= n; ++j) {
      sum += a[j - 1];
      if (sum >= k) break;
      if (sum == (a[i] ^ a[j]))
        st.insert(f ? make_pair(n - j + 1, n - i + 1) : make_pair(i, j));
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  cal(n);
  reverse(a + 1, a + 1 + n);
  cal(n, 1);
  cout << int(st.size());
  return 0;
}
