#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  os << '[';
  string sep = "";
  for (const auto &x : v) os << sep << x, sep = ", ";
  return os << ']';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) {
  return os << '(' << p.first << ", " << p.second << ')';
}
template <typename A>
ostream &operator<<(ostream &os, const set<A> &s) {
  os << '{';
  string sep = "";
  for (const auto &x : s) os << sep << x, sep = ", ";
  return os << '}';
}
template <typename A, typename B>
ostream &operator<<(ostream &os, const map<A, B> &m) {
  os << '{';
  string sep = "";
  for (const auto &x : m)
    os << sep << x.first << " -> " << x.second, sep = ", ";
  return os << '}';
}
constexpr int inf = 0x3f3f3f3f;
constexpr int maxn = 1e5 + 10;
constexpr int mod = 1000000007;
int main() {
  int n;
  scanf("%d", &n);
  vector<ll> a(n);
  for (ll &x : a) scanf("%lld", &x);
  int ans = 0;
  for (int l = n - 3; l >= 0; l--) {
    ll sum = a[l + 1];
    ll lim = 2ll << (31 - __builtin_clz(a[l]));
    for (int r = l + 2; r < n && sum < lim; r++) {
      if (a[l] > a[r] && sum == (a[l] ^ a[r])) ans++;
      sum += a[r];
    }
  }
  reverse((a).begin(), (a).end());
  for (int l = n - 3; l >= 0; l--) {
    ll sum = a[l + 1];
    ll lim = 2ll << (31 - __builtin_clz(a[l]));
    for (int r = l + 2; r < n && sum < lim; r++) {
      if (a[l] > a[r] && sum == (a[l] ^ a[r])) ans++;
      sum += a[r];
    }
  }
  printf("%d\n", ans);
}
