#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n;
  cin >> n;
  map<vector<bool>, long long int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    vector<int> t(26);
    vector<bool> v(26);
    cin >> s;
    for (auto c : s) {
      t[c - 'a']++;
    }
    for (int i1 = 0; i1 < 26; i1++) {
      t[i1] %= 2;
      if (t[i1] == 1) {
        v[i1] = 1;
      }
    }
    mp[v]++;
  }
  long long int ans1 = 0, ans2 = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    ans1 += (((itr->second) * (itr->second - 1)) / 2);
  }
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    vector<bool> t1;
    t1 = itr->first;
    if (mp[t1] == 0) {
      continue;
    }
    for (int i = 0; i < 26; i++) {
      vector<bool> t2;
      t2 = t1;
      if (t1[i] == 1) {
        t2[i] = 0;
      } else {
        t2[i] = 1;
      }
      if (mp.find(t2) == mp.end()) {
        continue;
      }
      ans2 += mp[t1] * mp[t2];
    }
  }
  ans2 /= 2;
  cout << ans2 + ans1 << endl;
}
