#include <bits/stdc++.h>
using namespace std;
int n;
unordered_map<int, int> cnt;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    int x = 0;
    for (auto it : s) {
      x ^= (1 << (it - 'a'));
    }
    ans += cnt[x];
    for (int j = 0; j < 26; j++) {
      x ^= (1 << j);
      ans += cnt[x];
      x ^= (1 << j);
    }
    cnt[x]++;
  }
  cout << ans;
}
