#include <bits/stdc++.h>
using namespace std;
long long n;
string s[100003];
unordered_map<long long, long long> cnt;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> s[i];
    long long curr_mask = 0;
    for (char j : s[i]) curr_mask ^= 1 << (j - 'a');
    cnt[curr_mask]++;
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    long long curr_mask = 0;
    for (char j : s[i]) curr_mask ^= 1 << (j - 'a');
    ans += (long long)(cnt[curr_mask] - 1);
    for (int j = 0; j < 26; j++) {
      curr_mask ^= 1 << j;
      ans += cnt[curr_mask];
      curr_mask ^= 1 << j;
    }
  }
  ans >>= 1;
  cout << ans << '\n';
}
