#include <bits/stdc++.h>
using namespace std;
unordered_map<long, long> M;
vector<long> P2;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long tmp = 1;
  long n;
  long long res = 0;
  cin >> n;
  for (auto i = 0; i != n; i++) {
    string s;
    cin >> s;
    long a = 0;
    for (auto j : s) {
      a ^= 1L << (long(j) - 97);
    }
    res += M[a];
    for (auto i = 0; i != 26; i++) {
      res += M[a ^ (1L << i)];
    }
    M[a]++;
  }
  cout << res;
  return 0;
}
