#include <bits/stdc++.h>
using namespace std;
map<int, int> cnt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int h = 0;
    for (int j = 0; j < s.size(); j++) {
      h ^= (1 << (s[j] - 'a'));
    }
    cnt[h]++;
  }
  long long ans = 0;
  for (auto data : cnt) {
    int cnt = data.second;
    int h = data.first;
    ans += (long long)cnt * (cnt - 1);
    for (int i = 0; i < 26; i++) {
      int new_h = h ^ (1 << i);
      if (::cnt.count(new_h)) {
        ans += (long long)cnt * ::cnt[new_h];
      }
    }
  }
  cout << ans / 2;
  return 0;
}
