#include <bits/stdc++.h>
using namespace std;
unordered_map<string, long long> mp;
unordered_map<string, long long>::iterator it;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, luw = 0, kent1 = 0, p[27];
  p[0] = 1;
  for (long long k = 1; k <= 26; k++) p[k] = p[k - 1] * 29;
  cin >> n;
  for (long long k = 1; k <= n; k++) {
    long long c[27];
    string ans;
    ans = ' ';
    for (long long j = 1; j <= 26; j++) c[j] = 0;
    string st;
    cin >> st;
    for (char h : st) c[h - 96]++;
    long long r = 0;
    for (long long j = 1; j <= 26; j++) {
      if (c[j] % 2) ans += (j + 96);
    }
    ans.erase(0, 1);
    mp[ans]++;
  }
  long long pas = 0;
  for (auto it = mp.begin(); it != mp.end(); it++) {
    long long j = (*it).second;
    pas += (j * (j - 1)) / 2;
    for (long long k = 0; k < (*it).first.size(); k++) {
      string tt;
      tt = (*it).first;
      tt.erase(k, 1);
      if (mp.count(tt) == 1 && mp[tt] > 0) pas += (mp[tt] * (*it).second);
    }
  }
  cout << pas;
  return 0;
}
