#include <bits/stdc++.h>
using namespace std;
const int N = 500010;
const int FUCKYOU = 26;
const int iinf = INT_MAX / 2;
const long long linf = LLONG_MAX / 2;
const int MOD = 1e9 + 7;
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
void print(int x) {
  cout << x << '\n';
  exit(0);
}
int cnt[FUCKYOU], tc[FUCKYOU], n;
long long ans;
char s[N * 10];
map<int, int> M;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> s + 1;
    memset(tc, 0, sizeof(tc));
    for (int j = 1; s[j]; j++) tc[s[j] - 'a']++;
    int p = 0;
    for (int j = 0; j <= 25; j++)
      if (tc[j] & 1) p += 1 << j;
    ans += M[p];
    for (int j = 0; j <= 25; j++) ans += M[p ^ (1 << j)];
    M[p]++;
  }
  cout << ans << '\n';
}
