#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const long double PI = acosl(-1.0);
const long long MOD = 1e9 + 7;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int main() {
  srand(time(0));
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long ans = 0;
  for (int rev = 0; rev < 2; rev++) {
    for (int i = 0; i < n; i++) {
      long long cur = 0;
      for (int j = i + 2; j < n; j++) {
        cur += a[j - 1];
        if (cur > 2 * a[i]) break;
        if ((a[i] ^ a[j]) == cur && a[i] > a[j]) ++ans;
      }
    }
    reverse(a.begin(), a.end());
  }
  cout << ans;
}
