#include <bits/stdc++.h>
using namespace std;
template <class C>
inline bool in_(const typename C::key_type& k, const C& A) {
  return A.find(k) != A.end();
}
inline bool in_(const string& s, const string& S) {
  return S.find(s) != string::npos;
}
const int maxb = 24;
int dp[1 << maxb];
int main() {
  ios::sync_with_stdio(false);
  int n;
  while (cin >> n) {
    for (int i = (0); i < (1 << maxb); ++i) dp[i] = 0;
    for (int i = (0); i < (n); ++i) {
      string s;
      cin >> s;
      int m = 0;
      for (int i = (0); i < (s.size()); ++i) m |= (1 << (s[i] - 'a'));
      dp[m]++;
    }
    for (int i = (0); i < (maxb); ++i)
      for (int mask = ((1 << maxb) - 1); mask > (0); --mask)
        if (mask & (1 << i)) {
          dp[mask] += dp[mask ^ (1 << i)];
        }
    int ans = 0;
    for (int i = (0); i < (1 << maxb); ++i) {
      const int x = n - dp[i];
      ans ^= x * x;
    }
    cout << ans << endl;
  }
  return 0;
}
