#include <bits/stdc++.h>
using namespace std;
int n, h;
int main() {
  long long ans = 0;
  string s;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++, h = 0) {
    cin >> s;
    for (int j = 0; j < s.length(); ++j) h ^= 1 << (int(s[j] - 97));
    for (int j = 0; j < 26; j++) ans += m[h ^ (1 << j)];
    ans += m[h]++;
  }
  cout << ans << endl;
}
