#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 0;
  for (int i = 0, sum = 0; i < n; i++) {
    sum = 0;
    for (int j = i + 1; j + 1 < n; j++) {
      sum += a[j];
      if (sum >= 2 * a[i]) break;
      if (sum == (a[i] ^ a[j + 1]) && a[i] > a[j + 1]) ans += 1;
    }
    sum = 0;
    for (int j = i - 1; j - 1 >= 0; j--) {
      sum += a[j];
      if (sum >= 2 * a[i]) break;
      if (sum == (a[i] ^ a[j - 1]) && a[i] > a[j - 1]) ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
