#include <bits/stdc++.h>
using namespace std;
map<char, long long int> cou;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    cou[s[0]]++;
  }
  long long int ans = 0;
  for (map<char, long long int>::iterator it = cou.begin(); it != cou.end();
       it++) {
    long long int req = it->second;
    long long int f = (req + 1) / 2;
    long long int s = req / 2;
    ans = ans + (f * (f - 1)) / 2 + (s * (s - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
