#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _R(T &x) {
  cin >> x;
}
template <typename T>
void _R(vector<T> &x) {
  for (auto it = x.begin(); it != x.end(); it++) {
    _R(*it);
  }
}
void R() {}
template <typename T, typename... K>
void R(T &head, K &...tail) {
  _R(head);
  R(tail...);
}
template <typename T>
void _W(const T &x, const char c) {
  cout << x;
}
template <typename T>
void _W(const vector<T> &x, const char c) {
  for (auto it = x.cbegin(); it != x.cend(); it++) {
    if (it != x.cbegin()) putchar(c);
    _W(*it, c);
  }
}
void W() {}
template <typename T, typename... K>
void W(const T &head, const K &...tail) {
  _W(head, ' ');
  cout << (sizeof...(tail) ? ' ' : '\n') << flush;
  W(tail...);
}
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
template <typename T>
inline T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
inline void amin(T &x, T y) {
  if (x > y) x = y;
}
template <typename T>
inline void amax(T &x, T y) {
  if (x < y) x = y;
}
template <typename A, typename B>
class comp {
 public:
  bool operator()(const pair<A, B> &a, const pair<A, B> &b) {
    if (a.first != b.first)
      return a.first < b.first;
    else
      return a.first > b.first;
  }
};
long long fast_exp(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1LL) {
      res *= a;
      res %= 1000000007;
    }
    b >>= 1LL;
    a *= a;
    a %= 1000000007;
  }
  return res;
}
const int MAXN = (1 << 24);
const int LOGN = 24;
int n;
int freq[MAXN], dp[MAXN];
void preprocess(void) { return; }
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int teeee;
  teeee = 1;
  for (int zeeee = (1); zeeee <= (teeee); zeeee++) {
    R(n);
    memset(freq, 0, sizeof freq);
    memset(dp, 0, sizeof dp);
    for (int i = (0); i <= ((int)(n)-1); i++) {
      string s;
      R(s);
      int mask = 0;
      mask |= (1 << (s[0] - 'a'));
      mask |= (1 << (s[1] - 'a'));
      mask |= (1 << (s[2] - 'a'));
      freq[mask]++;
    }
    for (int mask = (0); mask <= ((int)(MAXN)-1); mask++) dp[mask] = freq[mask];
    for (int i = (0); i <= ((int)(LOGN)-1); i++) {
      for (int mask = (MAXN - 1); mask >= (0); mask--) {
        if (mask & (1 << i)) {
          dp[mask] += dp[mask ^ (1 << i)];
        }
      }
    }
    int ans = 0;
    for (int mask = (0); mask <= ((int)(MAXN)-1); mask++) {
      int tans = n - dp[MAXN - 1 - mask];
      ans ^= (tans * tans);
    }
    W(ans);
  }
  cerr << ((double)clock() / (double)CLOCKS_PER_SEC) << endl;
  return 0;
}
