#include <bits/stdc++.h>
using namespace std;
long long int cost(long long int vi, long long int x, long long int f) {
  long long int lo = -1, hi = vi;
  while (hi - lo > 1) {
    long long int m = (hi + lo) / 2;
    if (vi - m * x <= f)
      hi = m;
    else
      lo = m;
  }
  return hi;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long int j = 0; j < s.size(); j++)
      v[i] = v[i] ^ (1 << (s[j] - 'a'));
  }
  map<long long int, long long int> m;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < 26; j++) ans += m[v[i] ^ (1 << j)];
    ans += m[v[i]];
    m[v[i]]++;
  }
  cout << ans;
  return 0;
}
