#include <bits/stdc++.h>
using namespace std;
int MAX_INT = numeric_limits<int>::max();
int MIN_INT = numeric_limits<int>::min();
long long MAX_LL = numeric_limits<long long>::max();
long long MIN_LL = numeric_limits<long long>::min();
long long string_to_ll(string word) {
  bitset<26> my_bits;
  for (int i = 0; i < word.size(); i++) {
    int pos = (word[i] - 'a');
    my_bits[pos] = !my_bits[pos];
  }
  return (long long)my_bits.to_ullong();
}
long long change_bit(long long num, int pos) {}
int main() {
  int n;
  cin >> n;
  vector<string> input(n);
  unordered_map<long long, int> my_map;
  long long cur;
  for (int i = 0; i < n; i++) {
    cin >> input[i];
  }
  for (int i = 0; i < n; i++) {
    cur = string_to_ll(input[i]);
    my_map[cur]++;
  }
  long long res = 0;
  long long max = 1 << 27;
  int pow;
  long long own;
  int to_find;
  bitset<27> pom;
  for (auto it = (my_map).begin(); it != (my_map).end(); ++it) {
    own = my_map[(*it).first];
    res += (own * (own - 1));
    for (int i = 0; i < 26; i++) {
      to_find = (*it).first;
      pom = to_find;
      pom[i] = !pom[i];
      to_find = (long long)pom.to_ullong();
      if (my_map.find(to_find) != my_map.end())
        res += own * (long long)(my_map[to_find]);
    }
  }
  cout << res / 2 << endl;
}
