#include <bits/stdc++.h>
using namespace std;
char a[1000005];
int n, b[100005], c;
long long sum, ans, ans1;
int cmp(int g, int h) { return (g | (1 << c)) < (h | (1 << c)); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", a);
    int sz = strlen(a);
    for (int j = 0; j < sz; ++j) b[i] ^= (1 << (a[j] - 65));
  }
  sort(b + 1, b + n + 1);
  b[n + 1] = 0x7fffffff;
  sum = 1;
  for (int i = 2; i <= n + 1; ++i) {
    if (b[i] == b[i - 1])
      ++sum;
    else
      ans += sum * (sum - 1) / 2, sum = 1;
  }
  for (int j = 0; j <= 25; ++j) {
    sum = 1;
    c = j;
    sort(b + 1, b + n + 1, cmp);
    for (int i = 2; i <= n + 1; ++i) {
      if (b[i] == b[i - 1] || !(b[i] ^ b[i - 1] ^ (1 << j)))
        ++sum;
      else
        ans1 += sum * (sum - 1) / 2, sum = 1;
    }
  }
  printf("%I64d\n", ans1 - 25 * ans);
  return 0;
}
