#include <bits/stdc++.h>
using namespace std;
void draganov47() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  draganov47();
  int n;
  cin >> n;
  unordered_map<long long, long long> mapa;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long cnt[26], mask = 0;
    for (int i = 0; i < 26; i++) cnt[i] = 0;
    for (auto x : s) cnt[x - 'a']++;
    for (int i = 0, j = 1; i < 26; i++, j *= 2) mask += (j * (cnt[i] & 1));
    for (int i = 0; i < 26; i++) ans += mapa[mask ^ (1 << i)];
    ans += mapa[mask]++;
  }
  cout << ans;
  return 0;
}
