#include <bits/stdc++.h>
using namespace std;
int n, m, k, q, x, y, z, temp;
int freq[26];
map<int, int> mp;
int main() {
  long long int atr, cnt;
  string s;
  cnt = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < s.size(); j++) {
      freq[s[j] - 'a'] ^= 1;
    }
    atr = 0;
    for (int j = 0; j < 26; j++) {
      atr <<= 1;
      atr += freq[j];
      freq[j] = 0;
    }
    if (mp.find(atr) != mp.end()) {
      cnt += mp[atr];
      mp[atr]++;
    } else {
      mp[atr] = 1;
    }
    for (int j = 0; j < 26; j++) {
      if (mp.find((atr ^ (1 << j))) != mp.end()) cnt += mp[(atr ^ (1 << j))];
    }
  }
  cout << cnt << '\n';
}
