#include <bits/stdc++.h>
using namespace std;
int di[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dj[] = {1, -1, 0, 0, -1, 1, 1, -1};
int count_odds(string &s) {
  vector<int> cnt(26, 0);
  for (auto c : s) {
    cnt[c - 'a']++;
  }
  int ret = 0;
  for (auto x : cnt) ret += (x & 1);
  return ret;
}
int to_mask(string &s) {
  vector<int> cnt(26, 0);
  for (auto c : s) {
    cnt[c - 'a']++;
  }
  int ret = 0;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (cnt[s[i] - 'a'] & 1) {
      ret |= (1 << (int)s[i] - 'a');
    }
  }
  return ret;
}
bool cmp(string &s1, string &s2) { return to_mask(s1) > to_mask(s2); }
int main() {
  int n;
  cin >> n;
  string a[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  map<int, int> mp;
  int even = 0, oneodd = 0;
  for (int i = 0; i < n; ++i) {
    int cnt = count_odds(a[i]);
    int msk = to_mask(a[i]);
    mp[msk]++;
  }
  sort(a, a + n, cmp);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    int cnt = count_odds(a[i]);
    int msk = to_mask(a[i]);
    mp[msk]--;
    ans += mp[msk];
    for (int i = 0; i < 26; ++i) {
      if (msk & (1 << i)) {
        msk ^= (1 << i);
        ans += mp[msk];
        msk ^= (1 << i);
      }
    }
  }
  cout << ans << '\n';
}
