#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
char s[1000010];
int cnt[30], A[100010];
int main() {
  int n, i, j;
  scanf("%d", &n);
  long long sum = 0;
  for (i = 1; i <= n; i++) {
    scanf("%s", &s);
    int m = strlen(s);
    memset(cnt, 0, sizeof(cnt));
    for (j = 0; j < m; j++) {
      cnt[s[j] - 'a' + 1]++;
    }
    int ans = 0;
    for (j = 1; j <= 26; j++) {
      ans = ans * 2;
      if (cnt[j] % 2) ans += 1;
    }
    if (ma.find(ans) != ma.end()) sum += ma[ans];
    int x;
    for (j = 1; j <= 26; j++) {
      if (ans & (1 << (j - 1)))
        x = ans - (1 << (j - 1));
      else
        x = ans + (1 << (j - 1));
      if (ma.find(x) != ma.end()) sum += ma[x];
    }
    A[i] = ans;
    if (ma.find(ans) == ma.end())
      ma[ans] = 1;
    else
      ma[ans]++;
  }
  cout << sum << endl;
}
