#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  set<pair<int, int>> ans;
  for (int &i : a) cin >> i;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    int b = 31 - __builtin_clz(a[i]);
    long long sum = 0;
    for (int j = i + 1; j < n && cnt < 2; j++) {
      if (sum == (a[i] ^ a[j]) && i + 1 < j) ans.insert({i, j});
      sum += a[j];
      cnt += (31 - __builtin_clz(a[j])) >= b;
    }
    sum = 0;
    cnt = 0;
    for (int j = i - 1; j >= 0 && cnt < 2; j--) {
      if (sum == (a[i] ^ a[j]) && i - 1 > j) ans.insert({j, i});
      sum += a[j];
      cnt += (31 - __builtin_clz(a[j])) >= b;
    }
  }
  cout << ans.size() << '\n';
  return 0;
}
