#include <bits/stdc++.h>
using namespace std;
long long int add(long long int x, long long int y) {
  x += y;
  while (x >= 1000000007) x -= 1000000007;
  while (x < 0) x += 1000000007;
  return x;
}
long long int mul(long long int x, long long int y) {
  return (x * 1ll * y) % 1000000007;
}
long long int binpow(long long int x, long long int y) {
  long long int z = 1;
  while (y) {
    if (y & 1) z = mul(z, x);
    x = mul(x, x);
    y >>= 1;
  }
  return z;
}
long long int inv(long long int x) { return binpow(x, 1000000007 - 2); }
long long int divide(long long int x, long long int y) {
  return mul(x, inv(y));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    vector<string> v;
    for (int i = 0; i < n; i++) {
      string h;
      cin >> h;
      v.push_back(h);
    }
    unordered_map<string, int> mm;
    for (int i = 0; i < n; i++) {
      string h = v[i];
      int arr[26] = {0};
      for (int j = 0; j < h.length(); j++) arr[h[j] - 'a']++;
      string s = "";
      for (int j = 0; j < 26; j++) {
        if (arr[j] % 2)
          s += "1";
        else
          s += "0";
      }
      mm[s]++;
    }
    long long int ans = 0;
    for (int i = 0; i < n; i++) {
      string h = v[i];
      int arr[26] = {0};
      for (int j = 0; j < h.length(); j++) arr[h[j] - 'a']++;
      string s = "";
      for (int j = 0; j < 26; j++) {
        if (arr[j] % 2)
          s += "1";
        else
          s += "0";
      }
      ans += mm[s] - 1;
      for (int j = 0; j < 26; j++) {
        if (s[j] == '1') {
          s[j] = '0';
          ans += mm[s];
          s[j] = '1';
        } else {
          s[j] = '1';
          ans += mm[s];
          s[j] = '0';
        }
      }
    }
    cout << ans / 2;
  }
  return 0;
}
