#include <bits/stdc++.h>
using namespace std;
inline void file() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  if (0) {
    freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);
  }
}
const int PX[8] = {1, 0, -1, 0, 1, 1, -1, -1},
          PY[8] = {0, 1, 0, -1, -1, 1, 1, -1}, N = (1 << 26) + 10, INF = 1e9,
          MOD = 1e9 + 7;
const long long INFL = 1e18, MODL = 1e9 + 7;
const long double EPS = 1e-6;
template <typename type>
inline void up(type& a, type b) {
  if (a < b) a = b;
}
inline long long rnd(long long l = 1, long long r = INFL) {
  unsigned long long ans = rand();
  ans = (ans << 16LL) ^ rand();
  ans = (ans << 16LL) ^ rand();
  ans = (ans << 16LL) ^ rand();
  ans %= r - l + 1;
  return (long long)ans + l;
}
long long ans;
int n, mask, bit;
string s;
map<int, int> cnt;
int main() {
  file();
  mask = 1 << 26;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    bit = 0;
    for (char j : s) bit ^= 1 << (j - 'a');
    ans += cnt[bit];
    for (int j = 0; j < 26; ++j)
      if (cnt.count(bit ^ (1 << j))) ans += cnt[bit ^ (1 << j)];
    ++cnt[bit];
  }
  cout << ans;
}
