#include <bits/stdc++.h>
using namespace std;
static int N, val[100001];
static long long ans;
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    static char buffer[1000002];
    scanf("%s", buffer);
    for (int j = 0; buffer[j]; j++) val[i] ^= (1 << (buffer[j] - 'a'));
  }
  sort(val, val + N);
  for (int i = 0, last = 0; i < N; i = last) {
    while (last < N && val[last] == val[i]) last++;
    ans += (long long)(last - i) * (last - i - 1) / 2;
    for (int j = 0; j < 26; j++)
      if (val[i] & (1 << j)) {
        int t = val[i] ^ (1 << j);
        int d = upper_bound(val, val + N, t) - lower_bound(val, val + N, t);
        ans += (long long)(last - i) * d;
      }
  }
  printf("%lld\n", ans);
  return 0;
}
