#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, i, count = 0, sum, mum;
  map<char, long long> m;
  map<char, long long>::iterator it;
  string s;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s;
    m[s[0]]++;
  }
  for (it = m.begin(); it != m.end(); it++)
    if (it->second > 2) {
      sum = (it->second) / 2;
      mum = (it->second) - sum;
      count += ((sum * (sum - 1)) / 2) + ((mum * (mum - 1)) / 2);
    }
  cout << count;
}
