#include <bits/stdc++.h>
using namespace std;
int n;
char A[100005 * 10];
long long ans;
map<int, long long> cnt;
int main() {
  scanf("%d", &n);
  int tot[26];
  for (int j = (1), j_end_ = (n); j <= j_end_; j++) {
    scanf("%s", A);
    int l = strlen(A);
    memset(tot, 0, sizeof(tot));
    for (int i = (0), i_end_ = (l - 1); i <= i_end_; i++) {
      tot[A[i] - 'a'] ^= 1;
    }
    int Sta = 0;
    for (int i = (0), i_end_ = (25); i <= i_end_; i++) {
      if (tot[i]) Sta |= 1 << i;
    }
    for (int i = (0), i_end_ = (25); i <= i_end_; i++) {
      int res = Sta ^ (1 << i);
      ans += cnt[res];
    }
    ans += cnt[Sta];
    cnt[Sta]++;
  }
  cout << ans << endl;
  return 0;
}
