#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int a[N];
set<pair<int, int>> s;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    int k = 0;
    for (int j = 30; j >= 0; j--)
      if (a[i] >> j & 1) {
        k = j;
        break;
      }
    int sum = a[i + 1];
    for (int j = i + 2; j <= n; j++) {
      if (sum > (1 << k + 1)) break;
      if ((a[i] ^ a[j]) == sum) {
        ans++;
        s.insert({i, j});
      }
      sum += a[j];
    }
  }
  reverse(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    int k = 0;
    for (int j = 30; j >= 0; j--)
      if (a[i] >> j & 1) {
        k = j;
        break;
      }
    int sum = a[i + 1];
    for (int j = i + 2; j <= n; j++) {
      if (sum > (1 << k + 1)) break;
      if ((a[i] ^ a[j]) == sum) {
        if (s.count({n - j + 1, n - i + 1}) == 0) ans++;
      }
      sum += a[j];
    }
  }
  cout << ans << endl;
}
