#include <bits/stdc++.h>
using namespace std;
struct Str {
  bool num[26];
  inline bool operator<(Str b) const {
    for (register int i = 0; i < 26; ++i)
      if (num[i] != b.num[i]) return num[i];
    return 0;
  }
  inline bool operator==(Str b) const {
    for (register int i = 0; i < 26; ++i)
      if (num[i] != b.num[i]) return 0;
    return 1;
  }
  inline void Insert(char s) { num[s - 'a'] ^= 1; }
  inline void clear() {
    for (register int i = 0; i < 26; ++i) num[i] = 0;
    return;
  }
};
map<Str, int> M;
int n;
const int N = 1e6 + 1;
char s[N];
int main() {
  scanf("%d", &n);
  register long long ans = 0;
  for (register int i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    register int len = strlen(s + 1);
    Str A, B;
    A.clear();
    for (register int j = 1; j <= len; ++j) A.Insert(s[j]);
    B = A;
    ans += M[B];
    for (register int i = 0; i < 26; ++i) {
      B.num[i] ^= 1;
      ans += M[B];
      B.num[i] ^= 1;
    }
    ++M[A];
  }
  printf("%I64d\n", ans);
}
