#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<string> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll ans = 0;
  map<int, int> f;
  for (string& s : a) {
    int mask = 0;
    for (char c : s) {
      mask ^= 1 << (c - 'a');
    }
    for (int i = 0; i < 26; i++) {
      if (f.count(mask ^ (1 << i))) {
        ans += f[mask ^ (1 << i)];
      }
    }
    ans += f[mask]++;
  }
  cout << ans << '\n';
}
