#include <bits/stdc++.h>
int buck[500] = {0};
char str[100];
int min(int a, int b) { return (a < b) ? a : b; }
int comb(int n, int k) {
  int C[n + 1][k + 1];
  int i, j;
  for (i = 0; i <= n; i++) {
    for (j = 0; j <= min(i, k); j++) {
      if (j == 0 || j == i)
        C[i][j] = 1;
      else
        C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
  }
  return C[n][k];
}
int main() {
  int n, i, an = 0, ans = 0, a;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", str);
    buck[str[0]] += 1;
  }
  for (i = 97; i <= 122; i++) {
    if (buck[i] > 2) {
      a = buck[i];
      if (a % 2 == 0) {
        an = 2 * comb(a / 2, 2);
      } else {
        if (a / 2 > 1)
          an = comb((a + 1) / 2, 2) + comb(a / 2, 2);
        else
          an = comb((a + 1) / 2, 2);
      }
      ans += an;
    }
  }
  printf("%d\n", ans);
  return 0;
}
