#include <bits/stdc++.h>
using namespace std;
const long long N = 1000000007;
const long long INF = 1000000000000000;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(numeric_limits<double>::max_digits10);
  long long n;
  cin >> n;
  map<string, long long> mp;
  for (long long t1 = 0; t1 < n; t1++) {
    string s;
    cin >> s;
    long long cnt[26] = {};
    for (long long t2 = 0; t2 < s.size(); t2++) {
      cnt[s[t2] - 'a']++;
    }
    string k = "00000000000000000000000000";
    for (long long t2 = 0; t2 < 26; t2++) {
      cnt[t2] %= 2;
      if (cnt[t2] == 1) {
        k[t2] = '1';
      }
    }
    mp[k]++;
  }
  long long ans = 0;
  for (auto it : mp) {
    string s1 = it.first;
    long long cnt1 = it.second;
    ans += (((cnt1) * (cnt1 - 1)) / 2);
    for (long long t1 = 0; t1 < 26; t1++) {
      if (s1[t1] == '1') {
        string s2 = s1;
        s2[t1] = '0';
        if (mp.find(s2) != mp.end()) {
          long long cnt2 = mp[s2];
          ans += (cnt1 * cnt2);
        }
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
