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