#include <bits/stdc++.h>
using namespace std;
int n, F[(1 << 24) + 123], ans;
vector<int> msk;
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    int mask = 0;
    for (int j = 0; j < (int)s.size(); ++j) mask = (mask | (1 << (s[j] - 'a')));
    F[mask]++;
  }
  for (int i = 0; i < 24; ++i)
    for (int mask = 0; mask < (1 << 24); ++mask) {
      if (mask & (1 << i)) F[mask] += F[mask ^ (1 << i)];
    }
  for (int mask = 0; mask < (1 << 24); ++mask) {
    int res = n - F[mask ^ ((1 << 24 - 1))];
    ans = (ans ^ (res * res));
  }
  cout << ans << "\n";
  return 0;
}
