#include <bits/stdc++.h>
using namespace std;
void fastIO();
void fileIO(string);
const int MAXN = (int)2e5 + 5;
int arr[MAXN];
long long t[MAXN];
int n;
long long ans;
void rec(int l, int r) {
  if (r - l + 1 < 3) {
    return;
  }
  int m = (l + r) >> 1;
  rec(l, m);
  rec(m + 1, r);
  t[m] = t[m + 1] = 0;
  for (int i = m - 1; i >= l; --i) {
    t[i] = t[i + 1] + arr[i + 1];
  }
  for (int i = m + 2; i <= r; ++i) {
    t[i] = t[i - 1] + arr[i - 1];
  }
  for (int i = l; i <= m; ++i) {
    if (arr[i] >= t[i]) {
      for (int j = m + 1; j <= r; ++j) {
        if (j - i + 1 >= 3 && (arr[i] ^ arr[j]) == t[i] + t[j]) {
          ++ans;
        }
      }
    }
  }
  for (int i = m + 1; i <= r; ++i) {
    if (arr[i] >= t[i]) {
      for (int j = l; j <= m; ++j) {
        if (arr[j] >= t[j]) {
          continue;
        }
        if (i - j + 1 >= 3 && (arr[i] ^ arr[j]) == t[i] + t[j]) {
          ++ans;
        }
      }
    }
  }
}
void solve() {
  cin >> n;
  for (int i = (1); i < (n + 1); ++i) {
    cin >> arr[i];
  }
  rec(1, n);
  cout << ans << endl;
}
int main() {
  int tt = 1;
  fastIO();
  while (tt--) {
    solve();
  }
  return 0;
}
void fastIO() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void fileIO(string S) {
  freopen((S + ".in").c_str(), "r", stdin);
  freopen((S + ".out").c_str(), "w", stdout);
}
