#include <bits/stdc++.h>
using namespace std;
map<string, long long> mp;
unsigned long long n, even, odd, sum;
string s;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    int f[26];
    for (int i = 0; i < (int)(26); ++i) f[i] = 0;
    bitset<26> x;
    for (int j = 0; j < s.size(); j++) {
      f[s[j] - 'a']++;
    }
    string a = "";
    int qq = 0;
    for (int j = 0; j < (int)(26); ++j) {
      if (f[j] % 2) {
        qq++;
        a += j + 'a';
      }
    }
    if (qq == 0) even++;
    if (qq) odd += qq == 1, mp[a]++;
  }
  sum += even * (even - 1) / 2;
  sum += even * odd;
  vector<string> v;
  for (auto x : mp) {
    sum += (x.second - 1) * x.second / 2;
    v.push_back(x.first);
  }
  for (int i = 0; i < (int)(int(v.size())); ++i) {
    string& x = v[i];
    for (int j = 0; j < (int)(int(x.size())); ++j) {
      string y = x.substr(0, j) + x.substr(j + 1);
      sum += mp[x] * mp[y];
    }
  }
  cout << sum;
  return 0;
}
