#include <bits/stdc++.h>
using namespace std;
unordered_map<int, int> A;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  int count[26];
  long long ans = 0;
  while (n--) {
    cin >> s;
    memset(count, 0, sizeof count);
    for (int i = 0; i < s.length(); i++) count[s[i] - 'a']++;
    int ind = 0;
    for (int i = 0; i < 26; i++) ind += (1 << i) * (count[i] % 2);
    if (A.count(ind)) ans += A[ind];
    for (int i = 0; i < 26; i++)
      if (A.count(ind ^ (1 << i))) ans += A[ind ^ (1 << i)];
    ++A[ind];
  }
  cout << ans << endl;
}
