#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
const int mod = (int)1e9 + 7;
const int N = 1e5 + 10;
const long long inf = -1e17;
vector<int> g[N];
vector<int> req;
struct event {
  long long a, b, c, d;
};
struct myComp {
  constexpr bool operator()(pair<int, int> const& a,
                            pair<int, int> const& b) const noexcept {
    return a.first < b.first;
  }
};
int dfs(int node, int parent) {
  int cnt = 0;
  for (auto it : g[node]) {
    if (it != parent) {
      cnt += dfs(it, node);
    }
  }
  if (g[node].size() == 1 && cnt == 0) cnt++;
  req[node] = cnt;
  return cnt;
}
void solve() {
  map<long long, long long> m;
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long curr = 0;
    vector<int> a(26);
    for (int j = 0; j < int(s.size()); j++) a[s[j] - 'a']++;
    for (int j = 0; j < 26; j++) {
      if (a[j] % 2 == 1) curr += (1 << j);
    }
    for (int j = 0; j < 26; j++) {
      if (a[j] % 2 == 1) {
        curr -= (1 << j);
        ans += m[curr];
        curr += (1 << j);
      }
    }
    for (int j = 0; j < 26; j++) {
      if (a[j] % 2 == 0) {
        curr += (1 << j);
        ans += m[curr];
        curr -= (1 << j);
      }
    }
    ans += m[curr];
    m[curr]++;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
