#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
long long n, ans = 0;
string a[N];
map<long long, long long> m;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    long long mask = 0;
    map<long long, long long> cur;
    for (auto &it : a[i]) cur[it]++;
    for (auto &it : cur) {
      if (it.second % 2) mask |= (1 << (it.first - 'a'));
    }
    m[mask]++;
  }
  for (auto &it : m) {
    if (it.first == 0) {
      ans += (it.second * (it.second - 1)) / 2;
      continue;
    }
    long long mask = it.first;
    long long covered = 0;
    for (long long j = 0; j < 26; j++) {
      if ((mask >> j) & 1) {
        long long curmask = mask & (~(1 << j));
        if (curmask < mask) {
          if (m.find(curmask) != m.end()) ans += it.second * m[curmask];
        }
      }
    }
    ans += (it.second * (it.second - 1)) / 2;
  }
  cout << ans;
  return 0;
}
