#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
inline int pow_(long long a, int n, int p = mod) {
  int r = 1;
  while (n) {
    if (n & 1) r = r * a % p;
    n >>= 1;
    a = a * a % p;
  }
  return r;
}
inline int inv_(int a) { return pow_(a, mod - 2, mod); }
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline void adds(int& a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline int mul(int a, int b) { return a * 1ll * b % mod; }
inline void muls(int& a, int b) { a = a * 1ll * b % mod; }
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < (n); ++i) {
    string s;
    cin >> s;
    int num = 0;
    for (int c : s) num ^= (1 << (c - 'a'));
    mp[num] += 1;
  }
  long long ans = 0;
  vector<int> v;
  v.push_back(0);
  for (int i = 0; i < (26); ++i) v.push_back(1 << i);
  for (auto p : mp) {
    for (int b : v) {
      int x = p.first ^ b;
      auto it = mp.find(x);
      if (it != mp.end()) {
        ans += it->second * 1ll * p.second;
      }
    }
  }
  ans -= n;
  ans >>= 1;
  cout << ans << "\n";
  return 0;
}
