#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, ll> co;
  while (n--) {
    string s;
    cin >> s;
    int m = 0;
    for (int i = 0; i < s.size(); ++i) {
      m ^= (1 << (s[i] - 'a'));
    }
    if (co.count(m) == 0) co[m] = 0;
    co[m]++;
  }
  ll ans = 0;
  vector<int> V;
  for (const auto& p : co) V.push_back(p.first);
  for (int p : V) {
    ans += co[p] * (co[p] - 1);
    for (int i = 0; i < 26; ++i) {
      ans += co[p] * co[p ^ (1 << i)];
    }
  }
  cout << ans / 2 << (char)10;
}
