#include <bits/stdc++.h>
using namespace std;
int dp[(1 << 24) + 5];
int main() {
  int n, mask = 0;
  string s;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> s;
    mask = 0;
    mask |= (1 << (s[0] - 'a'));
    mask |= (1 << (s[1] - 'a'));
    mask |= (1 << (s[2] - 'a'));
    dp[mask]++;
  }
  signed long long int ans = 0;
  for (int j = 0; j < 24; ++j) {
    for (int mask = 0; mask < (1 << 24); ++mask) {
      if (mask & (1 << j)) dp[mask] += dp[mask ^ (1LL << j)];
    }
  }
  for (int mask = 0; mask < (1 << 24); ++mask)
    ans ^= ((signed long long int)(n - dp[mask]) * (n - dp[mask]));
  cout << ans;
}
