#include <bits/stdc++.h>
using namespace std;
long long n, f[26], sum, ans;
string s;
bitset<26> a;
map<long long, long long> m;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  f[0] = 1;
  for (int i = 1; i < 26; i++) {
    f[i] = f[i - 1] * 2;
  }
  for (int i = 1; i <= n; i++) {
    cin >> s;
    sum = 0;
    for (int j = 0; j < s.length(); j++) {
      a[s[j] - 'a'] = !a[s[j] - 'a'];
    }
    for (int j = 0; j < 26; j++) {
      sum += f[j] * a[j];
      a[j] = 0;
    }
    ans += m[sum];
    for (int j = 0; j < 26; j++) {
      ans += m[sum ^ f[j]];
    }
    m[sum]++;
  }
  cout << ans << '\n';
}
