#include <bits/stdc++.h>
using namespace std;
long long a[200005], sum[200005], ans;
int n;
map<pair<int, int>, int> m;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] + a[i];
  }
  for (int i = 1; i <= n; i++) {
    long long t = a[i];
    int cnt = 0;
    while (t) {
      cnt++;
      t >>= 1;
    }
    long long maxx = 1 << cnt;
    for (int j = i + 2; j <= n; j++) {
      if (sum[j - 1] - sum[i] >= maxx) break;
      if ((sum[j - 1] - sum[i]) == (a[i] ^ a[j])) {
        pair<int, int> tmp = pair<int, int>(i, j);
        if (m[tmp] == 0) {
          m[tmp] = 1;
          ans++;
        }
      }
    }
  }
  for (int j = n; j >= 1; j--) {
    long long t = a[j];
    int cnt = 0;
    while (t) {
      cnt++;
      t >>= 1;
    }
    long long maxx = 1 << cnt;
    for (int i = j - 2; i >= 1; i--) {
      if (sum[j - 1] - sum[i] >= maxx) break;
      if ((sum[j - 1] - sum[i]) == (a[i] ^ a[j])) {
        pair<int, int> tmp = pair<int, int>(i, j);
        if (m[tmp] == 0) {
          m[tmp] = 1;
          ans++;
        }
      }
    }
  }
  cout << ans;
  return 0;
}
