#include <bits/stdc++.h>
using namespace std;
const int INFL = (int)1e9;
const long long int INFLL = (long long int)1e18;
const double INFD = numeric_limits<double>::infinity();
const double PI = 3.14159265358979323846;
bool nearlyeq(double x, double y) { return abs(x - y) < 1e-9; }
bool inrange(int x, int t) { return x >= 0 && x < t; }
long long int rndf(double x) {
  return (long long int)(x + (x >= 0 ? 0.5 : -0.5));
}
long long int floorsqrt(double x) {
  long long int m = (long long int)sqrt(x);
  return m + (m * m <= (long long int)(x) ? 0 : -1);
}
long long int ceilsqrt(double x) {
  long long int m = (long long int)sqrt(x);
  return m + ((long long int)x <= m * m ? 0 : 1);
}
long long int rnddiv(long long int a, long long int b) {
  return (a / b + (a % b * 2 >= b ? 1 : 0));
}
long long int ceildiv(long long int a, long long int b) {
  return (a / b + (a % b == 0 ? 0 : 1));
}
long long int gcd(long long int m, long long int n) {
  if (n == 0)
    return m;
  else
    return gcd(n, m % n);
}
int cvrt(string s) {
  int ret = 0;
  for (int i = 0; i < (int)s.length(); i++) {
    int x = s[i] - 'a';
    ret ^= (1 << x);
  }
  return ret;
}
vector<int> lst(int x) {
  vector<int> ret = {x};
  for (int i = 0; i < (int)26; i++) {
    ret.push_back(x ^ (1 << i));
  }
  return ret;
}
int main() {
  int n;
  cin >> n;
  map<int, long long int> mp;
  long long int ans = 0;
  for (int i = 0; i < (int)n; i++) {
    string s;
    cin >> s;
    int x = cvrt(s);
    vector<int> v = lst(x);
    for (int j = 0; j < (int)v.size(); j++) {
      ans += mp[v[j]];
    }
    mp[x]++;
  }
  cout << ans << endl;
}
