#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string buf;
  map<long long int, long long int> mp;
  for (long long i = 0; i < n; ++i) {
    cin >> buf;
    int len = int((buf).size());
    long long b = 0;
    vector<long long int> alp(26, 0);
    for (long long j = 0; j < len; ++j) {
      alp[buf[j] - 'a'] = (alp[buf[j] - 'a'] + 1) % 2;
    }
    for (long long j = 0; j < 26; ++j) {
      if (alp[j]) b = b | (1UL << j);
    }
    ++mp[b];
  }
  long long ans = 0;
  map<long long, long long> dupmp;
  for (auto it : mp) {
    dupmp[it.first] = it.second;
  }
  for (auto it : dupmp) {
    ans = ans + (it.second * (it.second - 1));
    for (long long j = 0; j < 26; ++j) {
      ans = ans + it.second * (mp[(it.first ^ (1UL << j))]);
    }
  }
  cout << ans / 2 << endl;
}
