#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  unordered_map<int, int> M;
  long long int ans = 0LL;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int cnt[26] = {};
    for (int j = 0; j < (int)s.length(); j++) cnt[s[j] - 'a'] ^= 1;
    int mask = 0;
    for (int j = 0; j < 26; j++)
      if (cnt[j]) mask |= (1 << j);
    ans += (1LL) * M[mask];
    for (int j = 0; j < 26; j++) ans += (1LL) * M[(mask ^ (1 << j))];
    M[mask]++;
  }
  cout << ans << endl;
  return 0;
}
