#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long u = 0, f = 1;
  while (c != '-' && (c < '0' || '9' < c)) c = getchar();
  if (c == '-') {
    f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    u = u * 10 + c - '0';
    c = getchar();
  }
  return u * f;
}
inline char readc() {
  for (;;) {
    char c = getchar();
    if ('A' <= c && c <= 'Z' || 'a' <= c && c <= 'z') return c;
  }
}
inline int read_digit() {
  for (;;) {
    char c = getchar();
    if ('0' <= c && c <= '9') return c - '0';
  }
}
inline int max(int a, int b) { return a > b ? a : b; }
inline int min(int a, int b) { return a < b ? a : b; }
template <typename T>
inline void updmax(T &a, T b) {
  if (b > a) a = b;
}
template <typename T>
inline void updmin(T &a, T b) {
  if (b < a) a = b;
}
inline void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
inline void fileio(string s) {
  if (s == "txt") {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  } else {
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);
  }
}
char a[1000010];
map<int, int> cnt;
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%s", a);
    int l = strlen(a);
    int b[26] = {0};
    for (int j = 0; j < l; j++) b[a[j] - 'a']++;
    int num = 0, id = 1;
    for (int j = 0; j < 26; j++) {
      if (b[j] % 2 == 1) num += id;
      id <<= 1;
    }
    ans += cnt[num];
    for (int j = 0; j < 26; j++) {
      int p = (1 << j);
      if (num & p)
        ans += cnt[num - p];
      else
        ans += cnt[num + p];
    }
    cnt[num]++;
  }
  cout << ans << endl;
  return 0;
}
