#include <bits/stdc++.h>
int c[28], f[100005];
unsigned short b[1 << 26];
char a[1000005];
int main() {
  long long ans = 0;
  int n, s = 0, q1 = -1, q2 = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", a), memset(c, 0, sizeof c);
    for (int j = strlen(a) - 1; ~j; j--) c[a[j] - 96]++;
    for (int j = 1; j <= 26; j++) f[i] = f[i] << 1 | (c[j] & 1);
    if (b[f[i]] == 60000)
      q1 = f[i], q2++;
    else
      b[f[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    ans += f[i] == q1 ? b[f[i]] + q2 : b[f[i]];
    for (int j = 0; j < 26; j++)
      ans += (f[i] ^ (1 << j)) == q1 ? q2 + b[q1] : b[f[i] ^ (1 << j)];
  }
  printf("%I64d", ans - n >> 1);
  return 0;
}
