#include <bits/stdc++.h>
int main() {
  int cnt, t, i, n, a[30] = {0};
  char name[200];
  scanf("%d", &n);
  while (n--) {
    scanf("%s", name);
    a[name[0] - 'a']++;
  }
  cnt = 0;
  for (i = 0; i < 26; i++) {
    t = a[i] / 2;
    cnt += t * (t - 1) / 2 + (a[i] - t) * (a[i] - t - 1) / 2;
  }
  printf("%d\n", cnt);
  return 0;
}
