#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n, ans;
int v[200005];
long long s[200005];
void solve() {
  for (int i = 1; i <= n; i++) s[i] = s[i - 1] + v[i];
  for (int i = 1; i <= n; i++) {
    int p = 29;
    while (!(v[i] & (1 << p))) p--;
    for (int j = i + 2; j <= n; j++) {
      if (s[j - 1] - s[i] >= (1 << (p + 1))) break;
      ans += (s[j - 1] - s[i] == (v[j] ^ v[i]) && v[i] >= v[j]);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> v[i];
  solve();
  reverse(v + 1, v + n + 1);
  solve();
  cout << ans;
  return 0;
}
