#include <bits/stdc++.h>
using namespace std;
char s1[3];
int n, dp[1 << 24], A[3];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s1);
    for (int j = 1; j < 8; j++) {
      int now = 0, cnt = 0;
      for (int k = 0; k < 3; k++)
        if (j & (1 << k)) now |= (1 << (s1[k] - 'a')), cnt++;
      if (cnt % 2)
        dp[now]++;
      else
        dp[now]--;
    }
  }
  long long ans = 0;
  for (int i = 0; i < 24; i++) {
    int now = ((1 << 24) - 1) - (1 << i);
    for (int j = now; j; j = now & (j - 1)) dp[j ^ (1 << i)] += dp[j];
  }
  for (int i = 0; i < (1 << 24); i++) ans ^= 1ll * (dp[i] * dp[i]);
  printf("%lld\n", ans);
  return 0;
}
