#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int s[N];
unordered_set<long long> st;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n - 2; i++) {
    int sum = s[i + 1];
    int mxn = 1 << (int)logb(s[i]) + 1;
    for (int j = i + 2; j <= n; j++) {
      if (sum > mxn) break;
      if ((s[i] ^ s[j]) == sum) st.insert(((long long)i << 32) + j);
      sum += s[j];
    }
  }
  for (int i = n; i >= 3; i--) {
    int sum = s[i - 1];
    int mxn = 1 << (int)logb(s[i]) + 1;
    for (int j = i - 2; j >= 1; j--) {
      if (sum > mxn) break;
      if ((s[i] ^ s[j]) == sum) st.insert(((long long)j << 32) + i);
      sum += s[j];
    }
  }
  cout << st.size() << endl;
  return 0;
}
