#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const long long maxn = (long long)1e6 + 5;
const long long mod = (long long)998244353;
const long long inf = 0x3f3f3f3f3f3f3f3f;
unordered_map<long long, long long> m;
long long a[maxn];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    for (auto &j : s) a[i] ^= 1 << (j - 'a');
  }
  m[a[1]] = 1;
  long long ans = 0;
  for (long long i = 2; i <= n; ++i) {
    ans += m[a[i]];
    for (long long j = 0; j < 26; ++j) ans += m[a[i] ^ (1 << j)];
    ++m[a[i]];
  }
  cout << ans;
  return 0;
}
