#include <bits/stdc++.h>
using namespace std;
template <class U, class T>
void Max(U &first, T second) {
  if (first < second) first = second;
}
template <class U, class T>
void Min(U &first, T second) {
  if (first > second) first = second;
}
template <class T>
void add(int &a, T b) {
  a = (a + b) % 1000000007;
}
inline int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int pow(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % 1000000007;
    a = 1LL * a * a % 1000000007;
    b >>= 1;
  }
  return ans;
}
int pow(int a, int b, int c) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1LL * ans * a % c;
    a = 1LL * a * a % c;
    b >>= 1;
  }
  return ans;
}
unordered_map<int, int> g;
char s[100010 * 10];
int v[26];
int main() {
  int ca = 0, T, k, i, j, m = 0, n, K;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    m = strlen(s);
    for (int j = 0; j < 26; j++) v[j] = 0;
    for (int j = 0; j < m; j++) {
      v[s[j] - 'a'] ^= 1;
    }
    int t = 0;
    for (int j = 0; j < 26; j++) {
      t <<= 1;
      if (v[j]) t |= 1;
    }
    if (g.count(t)) ans += g[t];
    for (int j = 0; j < 26; j++) {
      K = t ^ (1 << j);
      if (g.count(K)) ans += g[K];
    }
    g[t]++;
  }
  printf("%lld\n", ans);
}
