#include <bits/stdc++.h>
using namespace std;
int a[1 << 24];
void calc_sum(int m, int i, int k) {
  if (i < 0) {
    return;
  }
  calc_sum(m, i - 1, k);
  calc_sum(m + (1 << i), i - 1, k);
  for (int j = 0; j < (int)(1 << i); ++j) {
    a[m + (1 << i) + j] += a[m + j];
  }
}
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < (int)(N); ++i) {
    string s;
    cin >> s;
    int m = 0;
    for (int j = 0; j < (int)(3); ++j) {
      m |= 1 << (s[j] - 'a');
    }
    ++a[m];
  }
  calc_sum(0, 23, 24);
  int ans = 0;
  for (int i = 0; i < (int)((1 << 24)); ++i) {
    a[i] = N - a[i];
    ans ^= a[i] * a[i];
  }
  cout << ans << '\n';
  return 0;
}
