#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N];
int n, ans;
set<pair<int, int>> s;
void solve(int flag) {
  for (int i = 1; i < n; i++) {
    int t = log2(a[i]);
    long long sum = a[i + 1], up = (long long)1 << (t + 1);
    for (int j = i + 2; j <= n; j++) {
      if ((a[i] ^ a[j]) == sum) {
        ans++;
        if (flag)
          s.insert(make_pair(i, j));
        else
          ans -= s.count(make_pair(n - j + 1, n - i + 1));
      }
      sum += a[j];
      if (sum >= up) break;
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", a + i);
  solve(1);
  reverse(a + 1, a + n + 1);
  solve(0);
  printf("%d\n", ans);
  return 0;
}
