#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse2")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<string> v(n);
  map<long long, long long> m;
  long long ans = 0;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    vector<long long> f(26, 0);
    for (long long j = 0; j < v[i].length(); j++) {
      f[v[i][j] - 97] ^= 1;
    }
    long long tn = 0;
    for (long long j = 0; j < 26; j++) {
      if (f[j] == 1) tn += (1 << j);
    }
    ans += m[tn];
    for (long long j = 0; j < 26; j++) {
      if (f[j]) {
        long long tmp = tn - (1 << j);
        ans += m[tmp];
      } else {
        long long tmp = tn + (1 << j);
        ans += m[tmp];
      }
    }
    m[tn]++;
  }
  cout << ans;
  return 0;
}
