#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 24) + 5;
int n, sta, a[N], f[N];
char s[5];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    sta = 0;
    for (int i = 0; i < 3; i++) sta |= (1 << (s[i] - 'a'));
    for (int i = sta; i; i = (i - 1) & sta) {
      if (__builtin_popcount(i) & 1)
        a[i]++;
      else
        a[i]--;
    }
  }
  for (int i = 0; i < (1 << 24); i++) f[i] = a[i];
  for (int i = 0; i < 24; i++)
    for (int j = 0; j < (1 << 24); j++)
      if (j & (1 << i)) f[j] += f[j ^ (1 << i)];
  long long ans = 0;
  for (int i = 0; i < (1 << 24); i++) ans ^= 1LL * f[i] * f[i];
  printf("%lld\n", ans);
  return 0;
}
