#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const long long LINF = 1e18;
int n;
int A[200003];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  int res = 0;
  for (int i = 1; i <= n; i++) {
    int j = i;
    long long sum = 0;
    while (j > 2) {
      j--;
      sum += A[j];
      if (sum > 2 * A[i]) break;
      if (sum == (A[i] ^ A[j - 1]) && A[j - 1] < A[i]) {
        res++;
      }
    }
    j = i;
    sum = 0;
    while (j < n - 1) {
      j++;
      sum += A[j];
      if (sum > 2 * A[i]) break;
      if (sum == (A[i] ^ A[j + 1]) && A[j + 1] < A[i]) {
        res++;
      }
    }
  }
  printf("%d\n", res);
}
