#include <bits/stdc++.h>
#pragma GCC optimize "-O3"
using namespace std;
int n;
map<int, int> mm;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    int cur = 0;
    for (char c : s) cur ^= (1 << (c - 'a'));
    ans += mm[cur];
    for (int i = 0; i < 26; ++i) ans += mm[cur ^ (1 << i)];
    ++mm[cur];
  }
  cout << ans << "\n";
  return 0;
}
