#include <bits/stdc++.h>   using namespace std;   map<char, int> mp;   char t[27];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long n, mx = 0, ans = 0, f, f1;     string ch;     cin >> n;     for (int i = 0; i < n; i++) {       cin >> ch;       t[ch[0] -  a ]++;     }     for (int i = 0; i < 27; i++) {       mx = t[i];       f = mx / 2;       if (mx % 2 == 0)         f1 = mx / 2;       else         f1 = mx / 2 + 1;       ans += (f1 * (f1 - 1) / 2) + (f * (f - 1) / 2);     }     cout << ans;     return 0;   }   