#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  cin >> n;
  map<string, long long> mp;
  map<char, long long> t;
  for (long long y = 0; y < n; y++) {
    string s;
    cin >> s;
    for (long long i = 0; i < s.length(); i++) {
      t[s[i]]++;
    }
    s = "";
    for (auto i = t.begin(); i != t.end(); i++) {
      if (i->second % 2) s = s + i->first;
    }
    sort(s.begin(), s.end());
    mp[s]++;
    t.clear();
  }
  long long ans = 0;
  for (auto i = mp.begin(); i != mp.end(); i++) {
    ans += (i->second) * (i->second - 1) / 2;
    string v;
    for (long long j = 0; j < i->first.length(); j++) {
      v = i->first;
      v.erase(v.begin() + j);
      if (mp.find(v) != mp.end()) ans += mp[v] * i->second;
    }
  }
  cout << ans;
  return 0;
}
