#include <bits/stdc++.h>
using namespace std;
map<long long, long long> mask;
bool alphabet[32];
string str[100005];
void print(long long x) {
  while (x > 0) {
    cout << x % 2;
    x /= 2;
  }
  cout << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long otg = 0;
  ;
  long long EDINICI = 0;
  for (long long i = 0; i < n; i++) {
    cin >> str[i];
    for (long long j = 0; j < 26; j++) alphabet[j] = 0;
    for (long long j = 0; j < str[i].size(); j++) {
      long long k = alphabet[str[i][j] - 'a'];
      k = (k + 1) % 2;
      alphabet[str[i][j] - 'a'] = k;
    }
    long long currmask = 0;
    long long edinici = 0;
    for (long long j = 0; j < 26; j++) {
      if (alphabet[j]) {
        edinici++;
        currmask = (currmask | (1 << j));
      }
    }
    for (long long j = 0; j < 26; j++) {
      if (currmask & (1 << j)) {
        otg += mask[currmask ^ (1 << j)];
      } else {
        otg += mask[currmask | (1 << j)];
      }
    }
    otg += mask[currmask];
    mask[currmask]++;
  }
  cout << otg << endl;
  return 0;
}
