#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  map<string, long long int> count;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    vector<long long int> cc(26, 0);
    for (long long int j = 0; j < s.size(); j++) {
      cc[s[j] - 'a']++;
    }
    string key;
    for (long long int j = 0; j < 26; j++)
      if (cc[j] % 2 == 0)
        key.push_back('0');
      else
        key.push_back('1');
    count[key]++;
  }
  long long int ans = 0;
  for (auto &i : count) {
    ans += ((i.second) * (i.second - 1)) / 2;
  }
  long long int between = 0;
  for (auto &i : count) {
    for (long long int j = 0; j < 26; j++) {
      string curr = i.first;
      if (i.first[j] == '1') {
        curr[j] = '0';
        if (count.find(curr) != count.end()) between += i.second * count[curr];
      } else {
        curr[j] = '1';
        if (count.find(curr) != count.end()) between += i.second * count[curr];
      }
    }
  }
  cout << ans + between / 2 << endl;
  return 0;
}
