#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
long long mod = 1000000009;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
bool is_vowel(char c) {
  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y')
    return 1;
  return 0;
}
long double getDistance(long double x1, long double y1, long double x2,
                        long double y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
long long extended_euclidean(long long a, long long b, long long &x,
                             long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long g = extended_euclidean(b, a % b, y, x);
  y -= (a / b) * x;
  return g;
}
long long power(long long base, long long p) {
  if (p == 1) return base;
  if (!p) return 1ll;
  long long ret = power(base, p / 2);
  ret *= ret;
  ret %= mod;
  if (p & 1) ret *= base;
  return ret % mod;
}
pair<long long, int> vec(pair<long long, int> a, pair<long long, int> b) {
  pair<long long, int> ret =
      pair<long long, int>(a.first - b.first, a.second - b.second);
  return ret;
}
long long getArea(pair<long long, int> a, pair<long long, int> b,
                  pair<long long, int> c) {
  pair<long long, int> x = vec(a, b);
  pair<long long, int> y = vec(c, b);
  return abs(x.first * y.second - x.second * y.first);
}
int getID(string s) {
  int ret = 0;
  for (int i = (0); i <= (2); ++i) {
    ret |= (1 << (s[i] - 'a'));
  }
  return ret;
}
int n, dp[(1 << 24)];
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    string s;
    cin >> s;
    dp[getID(s)]++;
  }
  for (int i = (0); i <= (24); ++i) {
    for (int mask = (0); mask <= ((1 << 24) - 1); ++mask) {
      if (mask & (1 << i)) {
        dp[mask] += dp[mask ^ (1 << i)];
      }
    }
  }
  long long xorSum = 0;
  for (int i = (0); i <= ((1 << 24) - 1); ++i) {
    long long sum = n - dp[((1 << 24) - 1) & (~i)];
    sum *= sum;
    xorSum ^= sum;
  }
  cout << xorSum;
  return 0;
}
