#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
int n;
int F[(1 << 24) + 123];
vector<int> msk;
string tobin(int X) {
  string res = "";
  while (X) {
    res += char('0' + X % 2);
    X /= 2;
  }
  reverse((res).begin(), (res).end());
  while (res.size() < 24) res = '0' + res;
  return res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string second;
    cin >> second;
    int mask = 0;
    for (int j = 0; j < (int)second.size(); ++j)
      mask = (mask | (1 << (second[j] - 'a')));
    msk.push_back(mask);
  }
  for (auto X : msk) F[X]++;
  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)];
    }
  int ans = 0;
  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;
}
