#include <bits/stdc++.h>
using namespace std;
const int BITS = 24;
const int VALMAX = (1 << BITS);
int N;
long long ans, cnt[VALMAX + 5];
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    string s;
    cin >> s;
    int c1 = 1 << (s[0] - 'a');
    int c2 = 1 << (s[1] - 'a');
    int c3 = 1 << (s[2] - 'a');
    cnt[c1 | c2 | c3]++;
  }
  for (int i = 1; i <= BITS; i++) {
    int bit = (1 << (i - 1));
    for (int mask = bit; mask < (1 << BITS); mask = (mask + 1) | bit)
      cnt[mask] += cnt[mask ^ bit];
  }
  for (int q = 0; q < (1 << BITS); q++) {
    long long queryAns = cnt[((1 << BITS) - 1) ^ q];
    queryAns = N - queryAns;
    ans = ans ^ (queryAns * queryAns);
  }
  cout << ans << '\n';
  return 0;
}
