#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
const int N = 100000 + 100;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
long long a[N];
long long js[15];
int main() {
  int n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    int k = a[i] & 1;
    ans += js[k];
    ans -= ma[a[i] ^ 2];
    ans -= ma[a[i]];
    ma[a[i]]++;
    js[k]++;
  }
  cout << ans;
  return 0;
}
