#include <bits/stdc++.h>
using namespace std;
int n;
int dp[(1 << 24)];
int ans;
int main() {
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    int f = 0;
    for (int j = 0; j < 3; j++) f |= (1 << (s[j] - 'a'));
    dp[f]++;
  }
  ans = 0;
  for (int i = 0; i < 24; i++) {
    for (int j = 0; j < (1 << 24); j++)
      if (j & (1 << i)) dp[j] += dp[j ^ (1 << i)];
  }
  for (int i = 0; i < (1 << 24); i++) ans ^= (n - dp[i]) * (n - dp[i]);
  cout << ans;
  return 0;
}
