#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7;
const long long mod = 1e9 + 7;
long long t, n, m, k;
long long a[N];
long long sum[N];
set<pair<long long, long long> > st;
signed main() {
  long long t = 1;
  while (t--) {
    cin >> n;
    for (long long i = 1; i <= n; i++) {
      cin >> a[i];
      sum[i] = sum[i - 1] + a[i];
    }
    for (long long i = 1; i <= n; i++) {
      for (long long j = i + 2; j <= n; j++) {
        long long x = a[i] ^ a[j];
        long long ss = sum[j - 1] - sum[i];
        if (ss > a[i] * 2) break;
        if (x == ss) {
          st.insert(make_pair(i, j));
        }
      }
    }
    for (long long i = n; i >= 1; i--) {
      for (long long j = i - 2; j >= 1; j--) {
        long long x = a[i] ^ a[j];
        long long ss = sum[i - 1] - sum[j];
        if (ss > a[i] * 2) break;
        if (x == ss) {
          st.insert(make_pair(j, i));
        }
      }
    }
    cout << st.size() << endl;
  }
  return 0;
}
