#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int const N = 5e5 + 10, M = 2e7 + 1, oo = 1e9;
const int mod = oo + 7;
const long long OO = 3e18;
int n;
map<int, int> cnt;
string aa[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  long long res = 0;
  for (int i = 0; i < n; i++) {
    int fr[26] = {};
    cin >> aa[i];
    for (int j = 0; j < (int)aa[i].size(); j++) {
      fr[aa[i][j] - 'a']++;
      fr[aa[i][j] - 'a'] %= 2;
    }
    int rep = 0;
    for (int i = 0; i < 26; i++) rep += (fr[i] << i);
    res += cnt[rep];
    for (int i = 0; i < 26; i++) {
      int y = (1 << i) ^ rep;
      res += cnt[y];
    }
    cnt[rep]++;
  }
  cout << res;
  return 0;
}
