#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long N = 2e7;
const long long M = 1e4 + 10;
long long msk[M];
long long dp[N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    long long now = 0;
    for (long long j = 0; j < 3; j++) {
      char c;
      cin >> c;
      now = (now | (1 << (c - 'a')));
    }
    msk[i] = now;
    for (long long ii = msk[i]; ii > 0; ii = ((ii - 1) & msk[i])) {
      long long sgn = __builtin_popcount(ii) % 2 == 0 ? -1 : 1;
      dp[ii] += sgn;
    }
  }
  for (long long i = 0; i < 24; i++)
    for (long long mask = 0; mask < (1 << 24); mask++)
      if ((1ll & (mask >> i)) == 1) dp[mask] += dp[mask - (1ll << i)];
  long long df = (1 << 24) - 1;
  long long ans = 0;
  for (long long i = 0; i < (1 << 24); i++)
    ans = (ans ^ (dp[df - i] * dp[df - i]));
  cout << ans;
  return 0;
}
