#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int onecount[n];
  memset(onecount, 0, sizeof(int) * n);
  for (int i = 0; i < n; i++) {
    while (arr[i] > 0) {
      onecount[i] += (arr[i] % 2);
      arr[i] /= 2;
    }
  }
  int howmanybits[n][60];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 60; j++) {
      howmanybits[i][j] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    howmanybits[i][onecount[i]] = 1;
  }
  int cumulatebitcount[n][60];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 60; j++) {
      cumulatebitcount[i][j] = 0;
    }
  }
  for (int j = 0; j < 60; j++) {
    int cumulate = 0;
    for (int i = 0; i < n; i++) {
      cumulate += howmanybits[i][j];
      cumulatebitcount[i][j] = cumulate % 2;
    }
  }
  long long dp[n];
  memset(dp, 0, sizeof(long long) * n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 60; j++) {
      dp[i] += cumulatebitcount[i][j] * pow(2, j);
    }
  }
  unordered_map<long long, int> myMap;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += myMap[dp[i]];
    myMap[dp[i]]++;
  }
  cout << ans * 2 << endl;
}
