#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
long long a[N], tmp;
int n, ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= n; i++) {
    for (tmp = 0; tmp < a[i]; tmp = tmp * 2 + 1)
      ;
    for (int j = i + 2, sum = a[i + 1]; j <= n; sum += a[j++]) {
      if (sum > tmp) break;
      if (a[i] > a[j] && sum == (a[i] ^ a[j])) ans++;
    }
    for (int j = i - 2, sum = a[i - 1]; j >= 1; sum += a[j--]) {
      if (sum > tmp) break;
      if (a[i] > a[j] && sum == (a[i] ^ a[j])) ans++;
    }
  }
  printf("%d\n", ans);
}
