#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long ans = 0;
  map<int, int> mp;
  while (n--) {
    int h = 0;
    string str;
    cin >> str;
    for (int i = 0; i < str.length(); i++) h ^= 1 << (str[i] - 'a');
    for (int i = 0; i < 26; i++) ans += mp[h ^ (1 << i)];
    ans += mp[h]++;
  }
  cout << ans << "\n";
  return 0;
}
