#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  cin >> a;
  int sum = 0;
  unsigned char arr[a];
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < a - 1; i++) {
    for (int j = i + 1; j < a; j++) {
      sum = (arr[i] ^ arr[j]) + sum;
    }
  }
  cout << sum;
}
