#include <bits/stdc++.h>
using namespace std;
long long n, a[26], num, ans;
string s;
map<long long, long long> m;
set<long long> se;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long b = 0;
    cin >> s;
    for (int j = 0; j < (int)s.size(); j++) {
      a[s[j] - 'a']++;
    }
    for (int j = 0; j < 26; j++) {
      if (a[j] % 2) {
        b |= (1LL << j);
      }
      a[j] = 0;
    }
    m[b]++;
    se.insert(b);
  }
  for (auto k : se) {
    long long cnt = 0;
    long long b = k;
    num = m[b];
    for (int i = 0; i < 26; i++) {
      cnt |= (1LL << i);
      ans += m[b ^ cnt] * num;
      cnt = 0;
    }
    ans += num * (num - 1);
  }
  cout << ans / 2;
  return 0;
}
