#include <bits/stdc++.h>
using namespace std;
long long n;
long long c[30];
map<long long, long long> mp;
long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
long long QAQ() {
  memset(c, 0, sizeof(c));
  char ch = getchar();
  long long tmp = 0;
  while (!isalpha(ch)) ch = getchar();
  while (isalpha(ch)) c[ch - 'a'] ^= 1, ch = getchar();
  for (long long i = 0; i < 26; i++) tmp |= (c[i] << i);
  return tmp;
}
long long lowbit(long long x) { return x & (-x); }
long long sum(long long dig, long long x) {
  long long res = x * (x - 1) / 2;
  for (long long i = dig; i; i -= lowbit(i)) res += x * mp[dig - lowbit(i)];
  return res;
}
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++) mp[QAQ()]++;
  long long ans = 0;
  for (map<long long, long long>::iterator it = mp.begin(); it != mp.end();
       it++)
    ans += sum(it->first, it->second);
  printf("%I64d\n", ans);
  return 0;
}
