#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  scanf("%d", &n);
  unordered_map<int, int> S;
  long long sum = 0;
  char tmp[1000000];
  for (int i = 0; i < n; i++) {
    scanf("%s", tmp);
    string s = tmp;
    int F[26]{};
    for (int i = 0; i < s.length(); i++) F[s[i] - 'a']++;
    int bits = 0;
    for (int i = 0; i < 26; i++)
      if (F[i] % 2 == 1) bits |= (1 << i);
    if (S.find(bits) != S.end()) {
      sum += S[bits];
      S[bits]++;
    } else
      S[bits] = 1;
    for (int i = 0; i < 26; i++) {
      int bits_i = bits;
      bits_i ^= (1 << i);
      if (S.find(bits_i) != S.end()) sum += S[bits_i];
    }
  }
  printf("%I64d\n", sum);
}
