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