#include <bits/stdc++.h>
using namespace std;
const int BUF = 100005;
int nStr;
string str[BUF];
void read() {
  cin >> nStr;
  for (int i = 0; i < nStr; ++i) {
    cin >> str[i];
  }
}
int get(int mask, map<int, int> &mask2cnt) {
  return mask2cnt.count(mask) ? mask2cnt[mask] : 0;
}
void add(int mask, map<int, int> &mask2cnt) {
  if (!mask2cnt.count(mask)) {
    mask2cnt[mask] = 0;
  }
  ++mask2cnt[mask];
}
void work() {
  long long ans = 0;
  map<int, int> mask2cnt;
  for (int loop = 0; loop < nStr; ++loop) {
    string &s = str[loop];
    int mask = 0;
    for (int i = 0; i < s.size(); ++i) {
      mask ^= 1 << (s[i] - 'a');
    }
    ans += get(mask, mask2cnt);
    for (int i = 0; i < 26; ++i) {
      ans += get(mask ^ (1 << i), mask2cnt);
    }
    add(mask, mask2cnt);
  }
  cout << ans << endl;
}
int main() {
  read();
  work();
  return 0;
}
