#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
void cp() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long n;
  cin >> n;
  long long ans = 0;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long mask = 0;
    for (auto c : s) mask = mask ^ (1 << (c - 'a'));
    ans += mp[mask];
    for (long long j = 0; j < 26; j++) ans += mp[mask ^ (1 << j)];
    mp[mask]++;
  }
  cout << ans << endl;
}
int32_t main() {
  cp();
  long long t = 1;
  while (t--) solve();
  return 0;
}
