#include <bits/stdc++.h>   using namespace std;   map<long long, long long> m;   long long f(string s) {     long long ff[27] = {0}, ans = 0, i, j;     for (i = 0; i < s.size(); i++) {       ff[s[i] -  a ]++;     }     for (i = 0; i < 26; i++) {       if (ff[i] % 2) {         ans |= (1LL << i);       }     }     return ans;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n, i, j;     cin >> n;     string s[n + 1];     vector<long long> v;     for (i = 0; i < n; i++) {       cin >> s[i];       v.push_back(f(s[i]));     }     for (i = 0; i < v.size(); i++) m[v[i]]++;     long long ans = 0;     for (auto i : m) {       ans += (i.second * (i.second - 1)) / 2;     }     for (i = 0; i < 26; i++) {       map<long long, long long> mm;       for (j = 0; j < n; j++)         if (v[j] & (1 << i)) mm[v[j] ^ (1LL << i)]++;       for (auto j : mm) {         ans += m[j.first] * j.second;       }     }     cout << ans;     return 0;   }   