#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e9 + 7;
const long long int mod = 1e9 + 9;
long long int mini(long long int a, long long int b) {
  if (a >= b) return b;
  return a;
}
long long int maxi(long long int a, long long int b) {
  if (a >= b) return a;
  return b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int n;
  cin >> n;
  map<long long int, long long int> cnt;
  long long int ans = 0;
  vector<long long int> A;
  for (long long int i = 0; i <= n - 1; i++) {
    string s;
    cin >> s;
    long long int x = 0;
    for (long long int j = 0; j <= s.length() - 1; j++) {
      long long int mask = (1LL << (s[j] - 'a'));
      x ^= mask;
    }
    ans += cnt[x];
    cnt[x]++;
    A.push_back(x);
  }
  for (long long int i = 0; i <= n - 1; i++) {
    long long int x = A[i];
    for (long long int j = 0; j <= 25; j++) {
      long long int mask = (1LL << j);
      if (mask & x) {
        x ^= mask;
        ans += cnt[x];
        x ^= mask;
      }
    }
  }
  cout << ans;
  return 0;
}
