#include <bits/stdc++.h>
using namespace std;
int n;
long long a[200086];
set<pair<int, int> > st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (int i = 1; i + 2 <= n; i++) {
    long long x = 1;
    while (x <= a[i]) x <<= 1;
    x <<= 1;
    long long sum = a[i + 1];
    for (int j = i + 2; j <= n && sum < x; j++) {
      if ((a[i] ^ a[j]) == sum) st.insert({i, j});
      sum += a[j];
    }
  }
  for (int i = n; i - 2; i--) {
    long long x = 1;
    while (x <= a[i]) x <<= 1;
    x <<= 1;
    long long sum = a[i - 1];
    for (int j = i - 2; j && sum < x; j--) {
      if ((a[i] ^ a[j]) == sum) st.insert({j, i});
      sum += a[j];
    }
  }
  printf("%d", st.size());
}
