#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  map<int, int> appear;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    vector<int> cnt(26, 0);
    for (char c : s) cnt[c - 'a'] = (cnt[c - 'a'] + 1) % 2;
    int cur = 0;
    for (int i : cnt) cur = cur * 2 + i;
    appear[cur] += 1;
  }
  long long ans = 0;
  for (auto it = appear.begin(); it != appear.end(); ++it) {
    int cur = it->first;
    long long val = it->second;
    ans += (val - 1) * val / 2;
    int ex = 1;
    for (; ex <= 67108864; ex *= 2)
      if ((ex & cur) == 0) {
        if (appear.find(cur + ex) != appear.end())
          ans += val * appear[cur + ex];
      }
  }
  cout << ans;
  return 0;
}
