#include <bits/stdc++.h>
using namespace std;
int i, j;
const int M = 1e5 + 6, MAX = (1 << 26) + 6;
int tcnt[26];
string s[M];
int x[M];
map<int, int> cnt;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  long long ans = 0;
  while (n--) {
    string s;
    cin >> s;
    int x = 0;
    for (char ch : s) {
      x ^= 1 << (ch - 'a');
    }
    ans += (long long)cnt[x];
    for (i = 0; i < 26; i++) {
      ans += (long long)cnt[x ^ (1 << i)];
    }
    cnt[x]++;
  }
  cout << ans;
}
