#include <bits/stdc++.h>
using namespace std;
int arr[10001];
int F[16777215 + 10] = {0};
int main() {
  int N;
  cin >> N;
  int t_mask = 0;
  for (int i = 31; i > 23; i--) {
    t_mask = t_mask | (1 << i);
  }
  for (int n = 0; n < N; n++) {
    string s;
    cin >> s;
    int mask = 0;
    for (int i = 0; i < s.size(); i++) {
      mask = mask | ((1 << (s[i] - 'a')));
    }
    arr[n] = mask;
    F[arr[n]]++;
  }
  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)];
    }
  long long int ans = 0;
  for (int mask = 1; mask <= 16777215; mask++) {
    int tmp = (~mask) ^ t_mask;
    long long int a = (N - F[tmp]);
    ans = (ans ^ (a * a));
  }
  cout << ans;
  return 0;
}
