#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  unordered_map<vector<bool>, long long> mymap;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    vector<bool> v(26, false);
    for (long long i = 0; i < s.length(); i++) {
      if (v[s[i] - 'a'])
        v[s[i] - 'a'] = false;
      else
        v[s[i] - 'a'] = true;
    }
    auto it = mymap.find(v);
    if (it == mymap.end()) {
      mymap.insert(make_pair(v, 1));
    } else {
      (*it).second += 1;
    }
  }
  long long ans = 0;
  for (auto it : mymap) {
    if (it.second != 1) {
      ans += (it.second * (it.second - 1)) / 2;
    }
  }
  long long diff = 0;
  for (auto it : mymap) {
    for (long long i = 0; i < 26; i++) {
      vector<bool> v = it.first;
      if (v[i])
        v[i] = false;
      else
        v[i] = true;
      auto matchit = mymap.find(v);
      if (matchit != mymap.end()) {
        long long temp = (*matchit).second;
        diff += temp * it.second;
      }
    }
  }
  cout << ans + diff / 2 << endl;
  return 0;
}
