#include <bits/stdc++.h>
using namespace std;
long long n, a[1000005], ans;
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) scanf("%lld", &a[i]);
  for (long long i = 1; i <= n; i++) {
    long long num = 0;
    while (num < a[i]) num = num * 2 + 1;
    for (long long j = i - 2, sum = a[i - 1]; j > 0; j--) {
      if (sum > num) break;
      if (a[i] > a[j] && sum == (a[i] ^ a[j])) ans++;
      sum += a[j];
    }
    for (long long j = i + 2, sum = a[i + 1]; j <= n; j++) {
      if (sum > num) break;
      if (a[i] > a[j] && sum == (a[i] ^ a[j])) ans++;
      sum += a[j];
    }
  }
  cout << ans << endl;
  return 0;
}
