#include <bits/stdc++.h>
using namespace std;
long long n;
long long GenNum(string s) {
  long long charAppear[30];
  for (long long i = 0; i < 30; ++i) {
    charAppear[i] = 0;
  }
  for (auto i : s) {
    charAppear[i - 'a']++;
  }
  long long res = 0;
  for (long long i = 0; i < 26; ++i) {
    res += (1 << i) * (charAppear[i] & 1);
  }
  return res;
}
long long ans;
unordered_map<long long, long long> hashAppear;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    string s;
    cin >> s;
    long long tmp = GenNum(s);
    cerr << tmp << ' ';
    ans += hashAppear[tmp];
    for (long long i = 0; i < 26; ++i) {
      ans += hashAppear[tmp ^ (1 << i)];
    }
    hashAppear[tmp]++;
  }
  cout << ans;
  return 0;
}
