#include <bits/stdc++.h>
using namespace std;
void show() {}
template <typename T, typename... V>
void show(T t, V... v) {
  cerr << t;
  if (sizeof...(v)) cerr << ", ";
  show(v...);
}
template <class X>
bool mini(X& a, const X& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class X>
bool maxi(X& a, const X& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
typedef const int& ci;
int n;
int dp[1 << 24];
void enter() {
  cin >> n;
  for (int i = 1, _b = (n) + 1; i < _b; ++i) {
    char a, b, c;
    cin >> a >> b >> c;
    ++dp[(1 << a - 'a') | (1 << b - 'a') | (1 << c - 'a')];
  }
}
void solve() {
  int MASK = (1 << 24);
  for (int i = 0; i < 24; ++i)
    for (int mask = 0; mask < MASK; ++mask)
      if (mask >> i & 1) dp[mask] += dp[mask ^ (1 << i)];
  int res = 0;
  for (int mask = 0; mask < MASK; ++mask)
    if (dp[mask] != n) res ^= (n - dp[mask]) * (n - dp[mask]);
  cout << res;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(nullptr);
  enter();
  solve();
  cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms";
}
