#include <bits/stdc++.h>
using namespace std;
void load() {}
bool cnt[26];
map<int, int> dp;
long long ans = 0;
void trungtt() {
  int n;
  cin >> n;
  string x;
  while (n--) {
    cin >> x;
    memset(cnt, 0, sizeof(cnt));
    for (int i = 0; i < x.size(); ++i) cnt[x[i] - 'a'] = 1 - cnt[x[i] - 'a'];
    int Mark = 0;
    for (int i = 0; i <= 25; ++i)
      if (cnt[i]) Mark += (1 << i);
    ans += dp[Mark];
    for (int i = 0; i <= 25; ++i) ans += dp[Mark ^ (1 << i)];
    ++dp[Mark];
  }
  cout << ans;
}
int main() {
  load();
  trungtt();
  return 0;
}
