#include <bits/stdc++.h>
using namespace std;
namespace zzc {
const int maxn = (1 << 24) + 5;
int n, ans;
int f[maxn];
char ch[5];
void work() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", ch + 1);
    int tmp = 0;
    for (int i = 1; i <= 3; i++) tmp |= (1 << (ch[i] - 'a'));
    for (int i = tmp; i; i = (i - 1) & tmp) {
      if (__builtin_popcount(i) & 1)
        f[i]++;
      else
        f[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))];
    }
  }
  for (int i = 0; i < (1 << 24); i++) ans ^= (f[i] * f[i]);
  printf("%d\n", ans);
}
}  // namespace zzc
int main() {
  zzc::work();
  return 0;
}
