#include <bits/stdc++.h>
using namespace std;
long long dis[2002][2002];
long long ch[2002][2002];
long long mul(long long a, long long b) {
  return (a % 1000000007 * b % 1000000007) % 1000000007;
}
long long add(long long a, long long b) {
  return (a % 1000000007 + b % 1000000007) % 1000000007;
}
long long sub(long long a, long long b) {
  a = a - b;
  if (a < 0) a += 1000000007;
  return a;
}
long long cnt[26];
long long arr[100002];
long long calc_hash(string s) {
  memset(cnt, 0, sizeof(cnt));
  for (long long i = 0; i < s.size(); i++) {
    cnt[s[i] - 'a']++;
  }
  long long sum = 0;
  for (long long i = 0; i < 26; i++) {
    if (cnt[i] % 2 == 0) {
      sum += (1 << i);
    }
  }
  return sum;
}
signed main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    string s;
    cin >> s;
    arr[i] = calc_hash(s);
  }
  map<long long, long long> m;
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long hass = arr[i];
    ans += m[hass];
    for (long long j = 0; j < 26; j++) {
      if ((hass & (1 << j)))
        ans += m[hass - (1 << j)];
      else
        ans += m[hass + (1 << j)];
    }
    m[hass]++;
  }
  cout << ans << endl;
  return 0;
}
