#include <bits/stdc++.h>
using namespace std;
inline bool eq(double a, double b) { return fabs(a - b) < 1e-9; }
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int &n, int b) { n |= two(b); }
inline void unset_bit(int &n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
string s;
map<long long, long long> freq;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n;
  long long ans = 0;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    int mask = 0;
    cin >> s;
    for (int j = 0; j < (s.length()); ++j) {
      mask ^= (1 << (s[j] - 'a'));
    }
    ans += freq[mask];
    for (int j = 0; j < (26); ++j) {
      ans += freq[mask ^ (1 << j)];
    }
    freq[mask]++;
  }
  cout << ans << '\n';
  return 0;
}
