#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
  cerr << "Completed in " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds\n";
}
const long long N = 1e5 + 5;
long long n, ans, mask;
string s;
long long str_to_mask(string s) {
  long long f[26] = {0}, mask = 0;
  for (char c : s) f[c - 'a']++;
  for (long long i = 0; i < 26; i++)
    if (f[i] & 1) mask |= (1LL << i);
  return mask;
}
void solve() {
  cin >> n;
  map<long long, long long> f;
  for (long long i = 1; i <= n; i++) {
    cin >> s;
    mask = str_to_mask(s);
    ans += f[mask];
    for (long long j = 0; j < 26; j++) {
      ans += f[mask ^ (1LL << j)];
    }
    f[mask]++;
  }
  cout << ans;
}
