#include <bits/stdc++.h>
using namespace std;
int occ[26];
map<int, int> m;
void solve() {
  int n;
  cin >> n;
  long long ans = 0;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    memset(occ, 0, sizeof occ);
    for (long long j = 0; j < s.length(); ++j) {
      occ[s[j] - 'a']++;
    }
    int hsh = 0;
    for (long long j = 0; j < 26; ++j) {
      hsh += ((occ[j] % 2) << j);
    }
    for (long long j = 0; j < 26; ++j) {
      hsh ^= (1 << j);
      ans += m[hsh];
      hsh ^= (1 << j);
    }
    ans += (long long)m[hsh];
    m[hsh]++;
  }
  cout << ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
