#include <bits/stdc++.h>
using namespace std;
long long dp[(1ll << 24)];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  string s[n];
  long long x = 0;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    x = 0;
    cin >> s[i];
    for (long long j = 0; j < s[i].length(); j++)
      x = (x | (1ll << (s[i][j] - 'a')));
    dp[x]++;
    a[i] = x;
  }
  for (long long i = 0; i < 24; ++i) {
    for (long long mask = 0; mask < (1ll << 24); ++mask) {
      if ((mask >> i) & 1) dp[mask] += (dp[mask ^ (1ll << i)]);
    }
  }
  long long ans = 0;
  for (long long mask = 0; mask < (1ll << 24); ++mask) {
    x = (1ll << 24);
    x--;
    x ^= mask;
    ans ^= ((n - dp[x]) * (n - dp[x]));
  }
  cout << ans << '\n';
}
