#include <bits/stdc++.h>
using namespace std;
int a[200005];
void solve() {
  int n;
  scanf("%d ", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d ", &a[i]);
  }
  long long ret = 0;
  for (int cc = 0; cc < 2; ++cc) {
    for (int i = 0; i + 2 < n; ++i) {
      long long sum = a[i + 1];
      for (int j = i + 2; j < n && sum <= a[i] * 2; ++j) {
        if (sum == (a[i] ^ a[j])) {
          ++ret;
          if (cc == 0) {
            if (min(a[i], a[j]) * 2 >= sum) {
              --ret;
            }
          }
        }
        sum += a[j];
      }
    }
    reverse(a, a + n);
  }
  printf("%lld\n", ret);
}
int main() {
  solve();
  return 0;
}
