#include <bits/stdc++.h>
using namespace std;
map<int, int> Map;
int n, m, i, j;
long long ans;
string s;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s;
    m = s.size();
    bool cnt[30];
    for (j = 0; j < 26; j++) cnt[j] = 0;
    for (j = 0; j < m; j++) cnt[s[j] - 'a'] ^= 1;
    int aux1 = 0;
    for (j = 0; j < 26; j++) {
      aux1 <<= 1;
      aux1 |= cnt[j];
    }
    for (j = 0; j < 26; j++) ans += Map[aux1 ^ (1 << j)];
    ans += Map[aux1];
    Map[aux1]++;
  }
  cout << ans;
  return 0;
}
