Problem: Iahubina is tired of so many complicated languages, so she decided to invent a new, simple language. She already made a dictionary consisting of n 3-words. A 3-word is a sequence of exactly 3 lowercase letters of the first 24 letters of the English alphabet (a to x). She decided that some of the letters are vowels, and all the others are consonants. The whole language is based on a simple rule: any word that contains at least one vowel is correct.

Iahubina forgot which letters are the vowels, and wants to find some possible correct sets of vowels. She asks Iahub questions. In each question, she will give Iahub a set of letters considered vowels (in this question). For each question she wants to know how many words of the dictionary are correct, considering the given set of vowels.

Iahubina wants to know the xor of the squared answers to all the possible questions. There are 224 different questions, they are all subsets of the set of the first 24 letters of the English alphabet. Help Iahub find that number.

Input

The first line contains one integer, n (1 ≤ n ≤ 104). Each of the next n lines contains a 3-word consisting of 3 lowercase letters. There will be no two identical 3-words.

Output

Print one number, the xor of the squared answers to the queries.

Examples

Input

5
abc
aaa
ada
bcd
def


Output

0

Solution (in CPP):

Solution:
#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;
}