#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int maxn = 1000005;
char s[maxn];
unordered_map<int, int> cnt;
int n;
long long ans;
int main() {
  cin >> n;
  for (int i = (1), _E = (n); i <= _E; i++) {
    scanf("%s", s);
    int now = 0;
    for (int k = 0; s[k]; k++) now ^= 1 << (s[k] - 'a');
    for (int k = (0), _E = (25); k <= _E; k++) ans += cnt[now ^ (1 << k)];
    ans += cnt[now];
    cnt[now]++;
  }
  cout << ans << endl;
  return 0;
}
