#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
char s[maxn];
int tp[maxn >> 3], sz[maxn >> 3], n, cnt;
long long ans;
int main() {
  scanf("%d", &n);
  int l;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    l = strlen(s + 1);
    for (int k = 1; k <= l; k++) tp[i] ^= (1 << (int)(s[k] - 'a'));
  }
  sort(tp + 1, tp + 1 + n);
  cnt = 1;
  for (int i = 1; i <= n; i++) {
    if (tp[i] != tp[cnt]) tp[++cnt] = tp[i];
    ++sz[cnt];
  }
  for (int i = 1; i <= cnt; i++) {
    ans += 1LL * (sz[i] - 1) * sz[i] >> 1;
    for (int k = 0; k <= 25; k++)
      if (!((1 << k) & tp[i])) {
        int c = tp[i] | (1 << k);
        int p = lower_bound(tp + 1, tp + 1 + cnt, c) - tp;
        if (tp[p] != c) continue;
        ans += 1LL * sz[i] * sz[p];
      }
  }
  printf("%I64d\n", ans);
  return 0;
}
