#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  register int s = 0, t = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') t = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return s * t;
}
const long long N = 100001;
char s[1000001];
long long have[N], ans;
long long n;
map<long long, long long> cnt;
map<long long, long long> tot;
signed main() {
  n = read();
  for (register int i = 1; i <= n; ++i) {
    scanf("%s", s);
    register int len = strlen(s);
    long long res = 0;
    for (register int j = 0; j < len; ++j) {
      register int id = s[j] - 'a';
      res ^= (1ll << id);
    }
    have[i] = res;
    cnt[res]++;
  }
  for (register int i = 1; i <= n; i++) {
    ans += (cnt[have[i]] - 1 - tot[have[i]]);
    tot[have[i]]++;
    for (register int j = 0; j <= 30; j++)
      if (!(have[i] & (1ll << j))) ans += cnt[have[i] + (1ll << j)];
  }
  cout << ans << endl;
  return 0;
}
