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