#include <bits/stdc++.h>
int main() {
  int n, ara[26], count = 0;
  for (int i = 0; i < 26; i++) {
    ara[i] = 0;
  }
  scanf("%d", &n);
  char s[21];
  for (int i = 0; i < n; i++) {
    scanf(" %[^\n]", s);
    ara[s[0] - 97]++;
  }
  for (int i = 0; i < 26; i++) {
    if (ara[i] > 2) {
      int r1, r2;
      r1 = ara[i] / 2;
      r2 = ara[i] - r1;
      if (r1 > 1) count += r1 * (r1 - 1) / 2;
      if (r2 > 1) count += r2 * (r2 - 1) / 2;
    }
  }
  printf("%d", count);
  return 0;
}
