#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int mod = 998244353;
const int INF = 2147483647;
const int dx[] = {0, 0, 1, -1};
const int dy[] = {1, -1, 0, 0};
char s[maxn];
map<int, int> mp;
int P[26];
int main() {
  int n;
  scanf("%d", &n);
  P[0] = 1;
  for (int i = 1; i < 26; i++) P[i] = P[i - 1] << 1;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    int x = 0;
    for (int j = 0; s[j] != '\0'; j++) x ^= P[s[j] - 'a'];
    ans += mp[x];
    for (int j = 0; j < 26; j++) {
      auto it = mp.find(x ^ P[j]);
      if (it != mp.end()) ans += it->second;
    }
    mp[x]++;
  }
  printf("%lld\n", ans);
  return 0;
}
