#include <bits/stdc++.h>
using namespace std;
const int N = 1 << 24;
int dp[N];
int n, cnt;
int getbit(int x, int i) { return (x >> i) & 1; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int mask = 0;
    for (int j = 1; j <= 3; j++) {
      char c;
      cin >> c;
      mask |= 1 << (c - 'a');
    }
    dp[mask]++;
  }
  for (int i = 0; i < 24; i++)
    for (int mask = 0; mask < N; mask++)
      if (getbit(mask, i)) dp[mask] += dp[mask ^ (1 << i)];
  int ans = 0;
  for (int mask = 0; mask < N; mask++) {
    assert(dp[mask] <= n);
    dp[mask] = n - dp[mask];
    ans ^= dp[mask] * dp[mask];
  }
  cout << ans;
  return 0;
}
