#include <bits/stdc++.h>
using namespace std;
long long cont[200005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  while (cin >> n) {
    map<int, int> mp;
    long long ans = 0;
    while (n--) {
      string s;
      int cnt[26] = {};
      cin >> s;
      for (auto i : s) {
        cnt[i - 'a']++;
      }
      int now = 0;
      for (int i = 0; i < 26; i++) {
        if (cnt[i] & 1) {
          now |= (1 << i);
        }
      }
      ans += mp[now];
      for (int i = 0; i < 26; i++) {
        int fi = (1 << i) ^ now;
        if (mp.find(fi) != mp.end()) {
          ans += mp[fi];
        }
      }
      mp[now]++;
    }
    cout << ans << endl;
  }
}
