#include <bits/stdc++.h>
using namespace std;
long long MulModL(long long B, long long P, long long M) {
  long long R = 0;
  while (P > 0) {
    if ((P & 1ll) == 1) {
      R = (R + B);
      if (R >= M) R -= M;
    }
    P >>= 1ll;
    B = (B + B);
    if (B >= M) B -= M;
  }
  return R;
}
long long MulModD(long long B, long long P, long long M) {
  long long I = ((long double)B * (long double)P / (long double)M);
  long long R = B * P - M * I;
  R = (R % M + M) % M;
  return R;
}
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
template <class T1>
void deb(T1 e1) {
  cout << e1 << "\n";
}
template <class T1, class T2>
void deb(T1 e1, T2 e2) {
  cout << e1 << " " << e2 << "\n";
}
template <class T1, class T2, class T3>
void deb(T1 e1, T2 e2, T3 e3) {
  cout << e1 << " " << e2 << " " << e3 << "\n";
}
template <class T1, class T2, class T3, class T4>
void deb(T1 e1, T2 e2, T3 e3, T4 e4) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << "\n";
}
template <class T1, class T2, class T3, class T4, class T5, class T6>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << "\n";
}
template <class T1, class T2, class T3, class T4, class T5, class T6, class T7>
void deb(T1 e1, T2 e2, T3 e3, T4 e4, T5 e5, T6 e6, T7 e7) {
  cout << e1 << " " << e2 << " " << e3 << " " << e4 << " " << e5 << " " << e6
       << " " << e7 << "\n";
}
int getMask(string s) {
  int ret = 0;
  for (int i = 0; i < ((int)s.size()); i++) {
    ret |= (1 << (s[i] - 'a'));
  }
  return ret;
}
int getSqr(int s) { return s * s; }
const int MAX = (1 << 24) + 50;
int F[MAX];
int main() {
  int lim = (1 << 24) - 1;
  int n;
  char s[5];
  string a;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    a = s;
    F[getMask(a)]++;
  }
  for (int i = 0; i < 24; i++) {
    for (int j = lim; j > -1; j--) {
      if (j & (1 << i)) F[j] += F[j ^ (1 << i)];
    }
  }
  int res = 0;
  for (int i = lim; i > -1; i--) {
    res ^= getSqr(n - F[i ^ lim]);
  }
  deb(res);
  return 0;
}
