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