#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
const long long MOD = 1e9 + 7, di = 998244353, N = 2e6 + 1;
bool IsQuery = false;
long long q = 1, a[N], n;
map<int, vector<int>> edge;
map<int, bool> occ;
bool odd, even;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
struct Hash {
  vector<long long> hash1, p_pow1, hash2, p_pow2;
  long long p1 = 29, p2 = 31, MOD1 = 1e9 + 9, MOD2 = 1e9 + 7, n;
  Hash(string s) {
    n = s.size();
    p_pow1.resize(n + 1), p_pow2.resize(n + 1);
    hash1.resize(n + 1), hash2.resize(n + 1);
    p_pow1[0] = 1;
    p_pow2[0] = 1;
    for (int i = 1; i <= n; i++) {
      p_pow1[i] = (p_pow1[i - 1] * p1) % MOD1;
      p_pow2[i] = (p_pow2[i - 1] * p2) % MOD2;
    }
    hash1[0] = 0, hash2[0] = 0;
    for (int i = 1; i <= s.size(); i++) {
      hash1[i] = (hash1[i - 1] + (s[i - 1] - 'a' + 1) * p_pow1[i - 1]) % MOD1;
      hash2[i] = (hash2[i - 1] + (s[i - 1] - 'a' + 1) * p_pow2[i - 1]) % MOD2;
    }
  }
  pair<int, int> getHash(int i, int j) {
    int val1 =
        (((hash1[j + 1] - hash1[i] + MOD1) % MOD1) * p_pow1[n - i - 1]) % MOD1;
    int val2 =
        (((hash2[j + 1] - hash2[i] + MOD2) % MOD2) * p_pow2[n - i - 1]) % MOD2;
    return {val1, val2};
  }
};
void solve() {
  long long n, ans = 0, val;
  cin >> n;
  string s;
  map<int, int> f;
  for (int i = 0; i < n; i++) {
    cin >> s;
    val = 0;
    for (int i = 0; i < s.size(); i++) val ^= 1 << (s[i] - 'a');
    ans += f[val];
    for (int j = 0; j < 26; j++) ans += f[val ^ (1 << j)];
    ;
    f[val]++;
  }
  cout << ans;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  if (IsQuery) cin >> q;
  for (int i = 0; i < q; i++) {
    solve();
    cout << "\n";
  }
  return 0;
}
