#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, ALF_SZ = 30;
const long double EPS = 1e-7;
long long get_hh(string& s) {
  vector<long long> cnt(ALF_SZ, 0);
  for (char c : s) {
    ++cnt[c - 'a'];
  }
  long long hh = 0;
  for (long long i = 0; i < ALF_SZ; ++i) {
    if (cnt[i] % 2 == 1) {
      hh += (1 << i);
    }
  }
  return hh;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, ans = 0;
  cin >> n;
  map<long long, long long> hh_cnt;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    long long hh = get_hh(s);
    ans += hh_cnt[hh];
    for (long long i = 0; i < ALF_SZ; ++i) {
      hh ^= (1 << i);
      ans += hh_cnt[hh];
      hh ^= (1 << i);
    }
    ++hh_cnt[hh];
  }
  cout << ans << "\n";
  return 0;
}
