#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char name[21];
  int initials[26];
  cin >> n;
  memset(initials, 0, 26 * sizeof(int));
  for (int i = 0; i < n; ++i) {
    cin >> name;
    initials[name[0] - 'a']++;
  }
  int total = 0;
  for (int i = 0; i < 26; ++i) {
    int k = initials[i];
    if (k % 2)
      total += ((k - 1) / 2) * ((k - 1) / 2);
    else
      total += k / 2 * (k / 2 - 1);
  }
  cout << total << endl;
  return 0;
}
