#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 << 24;
int n, f[MAXN], Tohka;
bool p[MAXN];
int lowbit(int first) { return first & -first; }
int main() {
  cin >> n;
  char str[4];
  for (int i = 1; i <= n; ++i) {
    scanf("%s", str);
    int s = 0;
    for (int j = 0; j < 3; ++j) s |= 1 << (str[j] - 'a');
    ++f[s];
  }
  for (int i = 0; i < 24; ++i)
    for (int j = 1; j < MAXN; ++j)
      if (!(j & (1 << i))) f[j] += f[j + (1 << i)];
  p[0] = 0;
  for (int i = 1; i < MAXN; ++i)
    p[i] = p[i - lowbit(i)] ^ 1, f[i] *= (p[i]) ? 1 : -1;
  for (int i = 0; i < 24; ++i)
    for (int j = MAXN - 1; j >= 0; --j)
      if (j & (1 << i)) f[j] += f[j - (1 << i)];
  for (int i = 0; i < MAXN; ++i) Tohka ^= f[i] * f[i];
  cout << Tohka << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
