#include <bits/stdc++.h>
using namespace std;
int N, h;
int main() {
  long long ans = 0;
  string s;
  map<int, int> m;
  cin >> N;
  for (int t = 0; t < N; t++, h = 0) {
    cin >> s;
    for (int i = 0; i < s.length(); i++) h ^= 1 << (s[i] - 'a');
    for (int i = 0; i < 26; i++) ans += m[h ^ (1 << i)];
    ans += m[h]++;
  }
  cout << ans;
}
