#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = (long long)998244353ll;
const long long MAXN = (long long)1e5 + 10;
const long long INF = (long long)9223372036854775;
string a[MAXN];
long long b[MAXN][26];
long long p2[26];
map<long long, long long> ma;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  p2[0] = 1;
  for (int i = 1; i < 26; i++) p2[i] = p2[i - 1] * 2;
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < a[i].size(); j++) {
      b[i][a[i][j] - 'a'] = 1 - b[i][a[i][j] - 'a'];
    }
  }
  long long ans = 0, nu;
  for (int i = 0; i < n; i++) {
    nu = 0;
    for (int j = 0; j < 26; j++) nu += (b[i][j] * p2[j]);
    ma[nu]++;
  }
  for (int i = 0; i < n; i++) {
    nu = 0;
    for (int j = 0; j < 26; j++) nu += (b[i][j] * p2[j]);
    ans += ma[nu];
    for (int j = 0; j < 26; j++) {
      if (b[i][j] == 0)
        ans += ma[nu + p2[j]];
      else
        ans += ma[nu - p2[j]];
    }
  }
  cout << (ans - n) / 2 << endl;
  return 0;
}
