#include <bits/stdc++.h>
using namespace std;
namespace moonpie {
const int N = 2e5 + 5;
int n, a[N];
set<pair<int, int> > s;
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    int x = log2(a[i]);
    int sum = 0;
    for (int j = i + 1; j < n; ++j) {
      sum += a[j];
      if (sum > (1 << (x + 1))) break;
      if (sum == (a[i] ^ a[j + 1])) s.insert(pair<int, int>(i, j + 1));
    }
  }
  for (int i = n; i >= 1; --i) {
    int x = log2(a[i]);
    int sum = 0;
    for (int j = i - 1; j > 1; --j) {
      sum += a[j];
      if (sum > (1 << (x + 1))) break;
      if (sum == (a[i] ^ a[j - 1])) s.insert(pair<int, int>(j - 1, i));
    }
  }
  cout << s.size() << endl;
}
}  // namespace moonpie
signed main() {
  moonpie::solve();
  return 0;
}
