#include <bits/stdc++.h>
using namespace std;
const int N = (1 << 24) + 100;
int f[N], a[N];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int mas = 0;
    for (auto u : s) {
      mas |= 1 << (u - 'a');
    }
    a[mas]++;
  }
  for (int i = 0; i < (1 << 24); i++) {
    f[i] = a[i];
  }
  for (int i = 0; i < 24; i++) {
    for (int j = 0; j < (1 << 24); j++) {
      if (j & (1LL << i)) f[j] += f[j ^ (1 << i)];
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << 24); i++) {
    ans ^= (n - f[i]) * (n - f[i]);
  }
  cout << ans;
}
