#include <bits/stdc++.h>
using namespace std;
int binary2(int bina) {
  int ans = 0;
  for (int i = 0; bina > 0; i++) {
    ans = ans + (bina % 2) * pow(10, i);
    bina = bina / 2;
  }
  return ans;
}
int binary10(int bina) {
  int ans = 0;
  for (int i = 0; bina > 0; i++) {
    ans = ans + (bina % 10) * pow(2, i);
    bina = bina / 10;
  }
  return ans;
}
int main() {
  int count = 0;
  int anss = 0;
  int N;
  cin >> N;
  int A = 0;
  vector<int> retu(N);
  for (int i = 0; i < N; i++) {
    cin >> retu.at(i);
  }
  for (int j = 0; j < N; j++) {
    for (int k = 1 + A; k < N; k++) {
      count = 0;
      count = binary10(binary2(retu.at(j)) ^ binary2(retu.at(k)));
      anss = count + anss;
    }
    A++;
  }
  cout << anss << endl;
}
