#include <bits/stdc++.h>
int n, ans;
char s[11];
int f[1 << 24];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int mask = (1 << 24) - 1;
    scanf("%s", s);
    for (int j = 0; j < 3; j++) mask &= ((1 << 24) - 1) - (1 << (s[j] - 'a'));
    f[mask]++;
  }
  for (int i = 0; i < 24; i++) {
    for (int j = 0; j < (1 << i); j++)
      for (int k = 0; k < (1 << (24 - i - 1)); k++) {
        int val0 = (j << (24 - i)) + k;
        int val1 = ((j * 2 + 1) << (24 - i - 1)) + k;
        f[val0] += f[val1];
      }
  }
  ans = 0;
  for (int i = 0; i < (1 << 24); i++) {
    ans ^= (n - f[i]) * (n - f[i]);
  }
  printf("%d\n", ans);
  return 0;
}
