#include <bits/stdc++.h>
using namespace std;
const long long linf = 1LL << 62;
const int iinf = 1000000009;
const double dinf = 1e17;
const int Mod = 1e9 + 9;
const int maxn = 1000005;
char s[maxn];
unordered_map<long long, int> mp;
long long ans, cnt, tcnt;
int vs[30];
void solve() {
  ios::sync_with_stdio(false);
  int n, l;
  cin >> n;
  mp.clear();
  ans = 0;
  cnt = 0;
  for (int i = 1; i <= n; i++) {
    memset(vs, 0, sizeof(vs));
    cin >> s + 1;
    cnt = 0;
    l = strlen(s + 1);
    for (int j = 1; j <= l; j++) vs[s[j] - 'a']++;
    for (int j = 0; j <= 25; j++) {
      cnt = cnt + (1LL << j) * (vs[j] % 2);
    }
    ans += mp[cnt];
    for (int j = 0; j <= 25; j++) {
      tcnt = cnt;
      if (vs[j] % 2) {
        tcnt -= (1LL << j);
        ans += mp[tcnt];
      } else {
        tcnt += (1LL << j);
        ans += mp[tcnt];
      }
    }
    mp[cnt]++;
  }
  cout << ans << endl;
}
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
