#include <bits/stdc++.h>
using namespace std;
int arr[200001];
int main() {
  int a, b, c, i, j, k, m, n, ans;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> arr[i];
  ans = 0;
  for (i = 1; i <= n; i++) {
    int num = 0;
    int sum = 0;
    while (arr[i] >= num) {
      num = 2 * num + 1;
    }
    sum = arr[i - 1];
    for (j = i - 2; j > 0; j--) {
      if (sum > num) break;
      if (arr[i] >= arr[j] && sum == (arr[i] ^ arr[j])) ans++;
      sum += arr[j];
    }
    sum = arr[i + 1];
    for (j = i + 2; j <= n; j++) {
      if (sum > num) break;
      if (arr[i] > arr[j] && sum == (arr[i] ^ arr[j])) ans++;
      sum += arr[j];
    }
  }
  cout << ans << endl;
}
