#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
map<pair<int, int>, int> mp;
int a[N], ans, n;
void solve(int op) {
  for (int i = 1; i + 2 <= n; i++) {
    long long s = a[i + 1];
    int k = 0;
    for (int j = 0; j <= 29; j++)
      if (a[i] >> j & 1) k = j;
    if (!op) {
      for (int j = i + 2; j <= n; j++) {
        if (s == (a[i] ^ a[j])) ans++, mp[{n - j + 1, n - i + 1}] = 1;
        s += a[j];
        if (s >= (1 << k + 1)) break;
      }
    } else {
      for (int j = i + 2; j <= n; j++) {
        if (s == (a[i] ^ a[j]) && !mp.count({i, j})) ans++;
        s += a[j];
        if (s >= (1 << k + 1)) break;
      }
    }
  }
}
int main() {
  int T = 1;
  while (T--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    solve(0);
    reverse(a + 1, a + 1 + n);
    solve(1);
    cout << ans << endl;
  }
  return 0;
}
