#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long a[N];
map<pair<int, int>, bool> flag;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  int cnt = 0;
  for (int i = 1; i + 2 <= n; i++) {
    int k = 0;
    long long to = a[i + 1];
    for (int j = 32; j >= 0; j--)
      if ((a[i] >> j) & 1) {
        k = j;
        break;
      }
    for (int j = i + 2; j <= n; j++) {
      if ((a[i] ^ a[j]) == to) {
        cnt++;
        flag[{n - j + 1, n - i + 1}] = 1;
      }
      to += a[j];
      if (to >= (1 << (k + 1))) break;
    }
  }
  reverse(a + 1, a + n + 1);
  for (int i = 1; i + 2 <= n; i++) {
    int k = 0;
    long long to = a[i + 1];
    for (int j = 32; j >= 0; j--)
      if ((a[i] >> j & 1)) {
        k = j;
        break;
      }
    for (int j = i + 2; j <= n; j++) {
      if ((a[i] ^ a[j]) == to && !flag[{i, j}]) {
        cnt++;
      }
      to += a[j];
      if (to >= (1 << (k + 1))) break;
    }
  }
  cout << cnt << endl;
}
