#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;
const int inf = 1e9;
int n;
int a[N];
long long pre[N];
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pre[i] = pre[i - 1] + a[i];
  }
  set<pair<int, int> > ans;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 2; j <= n && pre[j - 1] - pre[i] <= 2 * a[i]; j++)
      if ((a[i] ^ a[j]) == pre[j - 1] - pre[i]) {
        ans.insert(make_pair(i, j));
      }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = i - 2; j >= 1 && pre[i - 1] - pre[j] <= 2 * a[i]; j--)
      if ((a[i] ^ a[j]) == pre[i - 1] - pre[j]) {
        ans.insert(make_pair(j, i));
      }
  }
  printf("%d\n", int(ans.size()));
  return 0;
}
