#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 8e7 + 5;
int a[N], bin[30], n;
long long ans;
char s[N * 10];
map<int, int> cnt;
int main() {
  bin[0] = 1;
  for (int i = 1; i < 26; ++i) bin[i] = bin[i - 1] << 1;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    int k = 0;
    for (int j = 1, len = strlen(s + 1); j <= len; ++j) k ^= bin[s[j] - 'a'];
    a[i] = k, ++cnt[k];
  }
  for (int i = 1; i <= n; ++i) {
    ans += cnt[a[i]] - 1;
    for (int j = 0; j < 26; ++j) ans += cnt[a[i] ^ bin[j]];
  }
  printf("%I64d\n", ans >> 1);
  return 0;
}
