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;
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;
}