#include <bits/stdc++.h>
using namespace std;
long long ans, cnt, n;
vector<string> S;
unordered_map<string, long long> mp;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s, p = "";
    cin >> s;
    int a[26];
    fill(a, a + 26, 0);
    for (int j = 0; j < s.size(); j++) {
      a[s[j] - 'a']++;
    }
    for (int j = 0; j < 26; j++) {
      if (a[j] % 2) {
        p += (j + 'a');
      }
    }
    mp[p]++;
    S.push_back(p);
  }
  for (auto it : mp) {
    if (it.second > 1) {
      ans += (it.second * (it.second - 1) / 2);
    }
  }
  cnt = 0;
  for (auto it : mp) {
    string s = it.first;
    long long num = it.second;
    if (s.size() >= 1) {
      for (int i = 0; i < s.size(); i++) {
        string P = s;
        P.erase(i, 1);
        if (mp.count(P)) {
          ans += num * mp[P];
        }
      }
    }
  }
  cout << ans;
  return 0;
}
