#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> f((1 << 24), 0);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    if (s.size() == 1) {
      int m = (1 << (s[0] - 'a'));
      f[m]++;
    } else if (s.size() == 2) {
      int a = s[0] - 'a', b = s[1] - 'a';
      int m1 = (1 << a), m2 = (1 << b);
      f[m1]++;
      f[m2]++;
      f[m1 | m2]--;
    } else {
      int a = s[0] - 'a', b = s[1] - 'a', c = s[2] - 'a';
      int m1 = (1 << a), m2 = (1 << b), m3 = (1 << c);
      f[m1]++, f[m2]++, f[m3]++;
      f[m1 | m2]--, f[m1 | m3]--, f[m2 | m3]--;
      f[m1 | m2 | m3]++;
    }
  }
  for (int i = 0; i < 24; i++) {
    for (int mask = (1 << 24) - 1; mask >= 0; mask--) {
      if ((mask >> i) & 1) f[mask] += f[mask ^ (1 << i)];
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << 24); i++) {
    ans ^= (f[i] * f[i]);
  }
  cout << ans << "\n";
  return 0;
}
