#include <bits/stdc++.h>
using namespace std;
int n, a[200100];
long long s[200100];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i), s[i] = s[i - 1] + a[i];
  multimap<long long, int> mp;
  int ans = 0;
  for (int i = n - 2; i >= 1; i--) {
    int p = i + 2;
    mp.insert(make_pair(s[p - 1] - a[p], p));
    for (multimap<long long, int>::iterator it = mp.begin(); it != mp.end();
         ++it) {
      if (it->first > a[i] + s[i]) break;
      if ((a[i] ^ a[it->second]) == s[it->second - 1] - s[i]) ans++;
    }
  }
  printf("%d\n", ans);
}
