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