#include <bits/stdc++.h>
using namespace std;
int process(string &s) {
  int ans = 0;
  for (int i = 0; i < s.size(); i++) ans ^= (1 << (s[i] - 'a'));
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  unordered_map<int, long long> m;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m[process(s)]++;
  }
  for (auto i : m) {
    for (int j = 0; j < 31; j++) {
      if (i.first & (1 << j)) {
        auto pos = m.find(i.first ^ (1 << j));
        if (pos != m.end()) ans += (pos->second * i.second);
      }
    }
  }
  for (auto i : m) {
    ans += (i.second * (i.second - 1)) / 2;
  }
  cout << ans;
}
