#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int ans = 0, fh = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    ans = (ans << 1) + (ans << 3) + ch - '0', ch = getchar();
  return ans * fh;
}
const int maxn = 1 << 26, maxm = 1e6 + 100, maxx = 1e5 + 100;
int n, b[maxx], tot[30];
long long ans;
char a[maxm];
map<int, int> mmp;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", a);
    int len = strlen(a);
    memset(tot, 0, sizeof(tot));
    for (int j = 0; j < len; j++) tot[a[j] - 'a']++;
    for (int j = 0, k = 1; j < 26; j++, k <<= 1) b[i] += k * (tot[j] % 2);
    mmp[b[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    int x = b[i];
    for (int j = 0, k = 1; j < 26; j++, k <<= 1) {
      int y = k ^ x;
      ans += mmp[y];
    }
    ans += mmp[x] - 1;
  }
  ans /= 2;
  printf("%I64d\n", ans);
  return 0;
}
