#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
map<int, int> mp0, mp1;
long long res;
char mde[N * 10];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int val = 0;
    scanf("%s", mde + 1);
    int len;
    for (len = 1; mde[len + 1] != '\0'; len++)
      ;
    for (int i = 1; i <= len; i++) val ^= (1 << (mde[i] - 'a'));
    if (len & 1) {
      res += mp1[val];
      for (int i = 0; i < 26; i++) res += mp0[val ^ (1 << i)];
      mp1[val]++;
    } else {
      res += mp0[val];
      for (int i = 0; i < 26; i++) res += mp1[val ^ (1 << i)];
      mp0[val]++;
    }
  }
  printf("%I64d", res);
  return 0;
}
