#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, L = 1e6 + 6;
map<int, int> mp;
int n, ext[N], base[30], len;
long long ans;
char re[L];
void pre() {
  for (int i = 0; i <= 28; i++) {
    base[i] = (1 << i);
  }
}
int main() {
  pre();
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", re + 1);
    len = strlen(re + 1);
    for (int j = 1; j <= len; j++) {
      ext[i] ^= base[re[j] - 'a'];
    }
    mp[ext[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    ans += mp[ext[i]] - 1;
    for (int j = 0; j < 26; j++) {
      ans += mp[ext[i] ^ base[j]];
    }
  }
  printf("%lld\n", ans / 2);
  return 0;
}
