#include <bits/stdc++.h>
using namespace std;
char s[1000005];
map<int, int> mp;
int main() {
  int n;
  long long ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    int vis[26] = {0};
    int len = strlen(s);
    for (int i = 0; i < len; i++) vis[s[i] - 'a']++;
    int s = 0;
    for (int i = 0; i < 26; i++)
      if (vis[i] % 2) s |= (1 << i);
    for (int i = 0; i < 26; i++) ans += mp[s ^ (1 << i)];
    ans += mp[s];
    mp[s]++;
  }
  printf("%I64d\n", ans);
}
