#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<string, long long> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    map<char, long long> ms;
    for (int i = 0; i < s.size(); i++) ms[s[i]]++;
    string s1 = "";
    for (char a = 'a'; a <= 'z'; a++) {
      if (ms[a] % 2 == 1)
        s1 += '1';
      else
        s1 += '0';
    }
    m[s1]++;
  }
  long long ans = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    string s = it->first;
    ans = ans + (m[s] * (m[s] - 1));
    long long cnt = m[s];
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') {
        s[i] = '1';
        if (m.find(s) != m.end()) ans = ans + cnt * m[s];
        s[i] = '0';
      } else {
        s[i] = '0';
        if (m.find(s) != m.end()) ans = ans + cnt * m[s];
        s[i] = '1';
      }
    }
  }
  cout << ans / 2;
}
