#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, j = 0, res = 0, x, sum1 = 0;
  cin >> n;
  string a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  map<long long, long long> m;
  vector<long long> v;
  long long d[26];
  for (i = 0; i < 26; i++) d[i] = pow(2, i);
  for (i = 0; i < n; i++) {
    long long b[26] = {0};
    x = 0;
    for (j = 0; j < a[i].length(); j++) b[a[i][j] - 97]++;
    for (int k = 0; k < 26; k++) {
      b[k] = b[k] % 2;
      x = x + b[k] * pow(2, k);
    }
    if (m[x] == 0) v.push_back(x);
    m[x]++;
  }
  for (i = 0; i < v.size(); i++) {
    res = res + (m[v[i]] * (m[v[i]] - 1)) / 2;
    for (j = 0; j < 26; j++) {
      long long z = (v[i]) ^ (d[j]);
      if (m[z] > 0) sum1 = sum1 + m[v[i]] * m[z];
    }
  }
  cout << res + (sum1) / 2 << endl;
  return 0;
}
