#include <bits/stdc++.h>
using namespace std;
map<int, int> le;
string x;
int y, z;
int f[28];
int n;
long long ans;
inline int read_int() {
  int s = 0, t = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') t = -1;
    c = getchar();
  }
  while (isdigit(c)) s = s * 10 + c - 48, c = getchar();
  return s * t;
}
inline string read_str() {
  string s = "";
  char c = getchar();
  while (c < 'a' || c > 'z') c = getchar();
  while ('a' <= c && 'z' >= c) {
    s += c;
    c = getchar();
  }
  return s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  n = read_int();
  for (int in = 1; in <= n; in++) {
    x = read_str();
    y = 0;
    memset(f, 0, sizeof(f));
    for (int i = 0; i < x.size(); i++) f[x[i] - 'a']++;
    for (int i = 0; i < 26; i++)
      if (f[i] % 2 != 0) y += 1 << i;
    ans += le[y] * 1ll;
    z = y;
    for (int i = 0; i < 26; i++) {
      if (f[i] % 2 == 1)
        z -= 1 << i;
      else
        z += 1 << i;
      ans += le[z] * 1LL;
      z = y;
    }
    le[y]++;
  }
  cout << ans;
  return 0;
}
