#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int b[31][n];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 30; j++) {
      b[j][i] = a[i] % 2;
      a[i] = a[i] / 2;
    }
  }
  int pr[31][n + 1];
  for (int i = 0; i <= 30; i++) {
    pr[i][0] = 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= 30; j++) {
      pr[j][i + 1] = (pr[j][i] + b[j][i]) % 2;
    }
  }
  vector<int> bi(n + 1);
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= 30; j++) {
      int s = pow(2, j);
      bi[i] = bi[i] + s * pr[j][i];
    }
  }
  int raz1 = (n + 2) / 2;
  int raz2 = (n + 1) / 2;
  vector<int> bi1(raz1);
  for (int i = 0; i < raz1; i++) {
    bi1[i] = bi[i * 2];
  }
  vector<int> bi2(raz2);
  for (int i = 0; i < raz2; i++) {
    bi2[i] = bi[i * 2 + 1];
  }
  sort(bi1.begin(), bi1.end());
  long long col = 0;
  long long col1 = 1;
  for (int i = 1; i < raz1; i++) {
    if (bi1[i] != bi1[i - 1]) {
      long long col2 = col1 * (col1 - 1) / 2;
      col = col + col2;
      col1 = 1;
    } else {
      col1++;
      if (i == raz1 - 1) {
        long long col2 = col1 * (col1 - 1) / 2;
        col = col + col2;
      }
    }
  }
  sort(bi2.begin(), bi2.end());
  col1 = 1;
  for (int i = 1; i < raz2; i++) {
    if (bi2[i] != bi2[i - 1]) {
      long long col2 = col1 * (col1 - 1) / 2;
      col = col + col2;
      col1 = 1;
    } else {
      col1++;
      if (i == raz2 - 1) {
        long long col2 = col1 * (col1 - 1) / 2;
        col = col + col2;
      }
    }
  }
  cout << col;
  return 0;
}
