#include <bits/stdc++.h>
using namespace std;
int n, a[1000000], b[1000000];
set<pair<int, int>> s;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    b[i] = 1;
    scanf("%d", &a[i]);
    while (b[i] <= a[i]) b[i] <<= 1;
  }
  for (int i = 1; i <= n; i++) {
    int sum = 0;
    for (int j = i + 2; j <= n; j++) {
      sum += a[j - 1];
      if (sum > b[i]) break;
      if ((a[i] ^ a[j]) == sum) s.insert(make_pair(i, j));
    }
  }
  for (int i = n; i; i--) {
    int sum = 0;
    for (int j = i - 2; j; j--) {
      sum += a[j + 1];
      if (sum > b[i]) break;
      if ((a[i] ^ a[j]) == sum) s.insert(make_pair(j, i));
    }
  }
  printf("%d", s.size());
  return 0;
}
