#include <bits/stdc++.h>
int n, m = 24, x, ans;
int f[1 << 24];
char s[5];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s), x = 0;
    for (int j = 0; j < 3; ++j) x |= 1 << s[j] - 97;
    ++f[x];
  }
  for (int j = 0; j < m; ++j)
    for (int i = 0; i < 1 << m; ++i)
      if (i >> j & 1) f[i] += f[i ^ 1 << j];
  for (int i = 0; i < 1 << m; ++i) ans ^= (n - f[i]) * (n - f[i]);
  printf("%d\n", ans);
  return 0;
}
