#include <bits/stdc++.h>
using namespace std;
const int base = (1 << 24) - 1;
int n, opt[base + 1], ans;
char s[3];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    int stat = 0;
    for (int j = 0; j < 3; j++) stat |= 1 << (s[j] - 'a');
    opt[stat]++;
  }
  for (int i = 0; i < 24; i++)
    for (int j = 0; j < base; j++)
      if (!(j & (1 << i))) opt[j | (1 << i)] += opt[j];
  int sol = 0;
  for (int i = 0; i < base; i++) ans ^= (n - opt[i]) * (n - opt[i]);
  printf("%d\n", ans);
  return 0;
}
