#include <bits/stdc++.h>
using namespace std;
string arr[1000000];
long long aux[26];
unordered_map<long long, long long> freq;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long tot = 0;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < 26; j++) aux[j] = 0;
    for (long long j = 0; j < arr[i].size(); j++) aux[arr[i][j] - 'a']++;
    long long l = 0;
    for (long long j = 0; j < 26; j++) {
      if (aux[j] % 2 == 1) l += (1 << j);
    }
    tot += freq[l];
    for (long long j = 0; j < 26; j++) {
      if (aux[j] % 2 == 0) {
        l += (1 << j);
        tot += freq[l];
        l -= (1 << j);
      } else {
        l -= (1 << j);
        tot += freq[l];
        l += (1 << j);
      }
    }
    freq[l]++;
  }
  cout << tot;
  return 0;
}
