#include <bits/stdc++.h>
using namespace std;
const int LOG = 24;
const int N = 1 << LOG;
int f[N];
long long sqr(long long a) { return a * a; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int rep = 0;
    for (auto c : s) {
      rep |= (1 << (c - 'a'));
    }
    f[rep]++;
  }
  for (int i = 0; i < LOG; i++)
    for (int mask = 0; mask < N; mask++)
      if (mask & (1 << i)) f[mask] += f[mask ^ (1 << i)];
  long long ans = 0;
  for (int i = 0; i < N; i++) {
    int oppo = (N - 1) ^ i;
    ans ^= sqr(n - f[oppo]);
  }
  cout << ans << endl;
}
