#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
unordered_map<long long, long long> mmp;
long long num[1000006];
long long n;
long long A[26], res;
int main() {
  cin >> n;
  getchar();
  for (long long i = 0; i < n; ++i) {
    static char ch;
    memset(A, 0, sizeof A);
    while (ch = getchar())
      if (ch != '\n')
        ++A[ch - 'a'];
      else
        break;
    for (long long j = 0; j < 26; ++j) num[i] |= ((A[j] % 2) << j);
  }
  sort(num, num + n);
  for (long long i = 0; i < n; ++i) {
    res += mmp[num[i]];
    for (long long j = 0; j < 26; ++j)
      if ((num[i] >> j) & 1) res += mmp[num[i] ^ (1 << j)];
    ++mmp[num[i]];
  }
  cout << res;
}
