#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  int n;
  cin >> n;
  string a[n];
  int f[n];
  int x = 24;
  int sz = (1ll << x) - 1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    f[i] = 0;
    for (int j = 0; j < 3; j++) {
      f[i] |= (1ll << (a[i][j] - 'a'));
    }
  }
  vector<int> dp(sz + 1, 0);
  for (int i = 0; i < n; i++) {
    dp[f[i]]++;
  }
  for (int j = 0; j < 24; j++) {
    for (int i = 1; i <= sz; i++) {
      if (i & (1ll << j)) dp[i] += dp[i ^ (1ll << j)];
    }
  }
  int ans = 0;
  for (int i = 0; i <= sz; i++) {
    int p = (n - dp[i ^ sz]) * 1ll * (n - dp[i ^ sz]);
    ans ^= p;
  }
  cout << ans << endl;
  return 0;
}
