#include <bits/stdc++.h>
using namespace std;
void DBG() { cerr << "]\n"; }
template <typename T, typename... Args>
void DBG(T first, Args... args) {
  cerr << first;
  if (sizeof...(args)) cerr << ", ";
  DBG(args...);
}
void solve() {
  long long n;
  cin >> n;
  string a[n];
  map<string, long long> m;
  long long even = 0;
  long long extra = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    vector<long long> v(26, 0);
    for (long long j = 0; j < a[i].length(); j++) {
      v[a[i][j] - 'a']++;
    }
    string s = "00000000000000000000000000";
    for (long long j = 0; j < 26; j++) {
      if (v[j] % 2 != 0) s[j] = '1';
    }
    m[s]++;
  }
  for (auto ele : m) {
    string s = ele.first;
    for (long long j = 0; j < s.length(); j++) {
      string temp = s;
      temp[j] = ((temp[j] - '0') ^ 1) + '0';
      if (m.count(temp)) extra += m[s] * m[temp];
    }
  }
  long long ans = 0;
  for (auto ele : m) {
    ans += ele.second * (ele.second - 1) / 2;
  }
  ans += extra / 2;
  cout << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long t = 1;
  while (t--) solve();
}
