#include <bits/stdc++.h>
int calculate_n_choose_2(int n);
int main() {
  int alphabet[26] = {0};
  char string[25];
  int n, answer;
  answer = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", string);
    alphabet[string[0] - 'a']++;
  }
  for (int i = 0; i < 26; i++) {
    if (alphabet[i] > 1) {
      if (alphabet[i] % 2 == 0) {
        answer += 2 * calculate_n_choose_2(alphabet[i] / 2);
      } else {
        answer += calculate_n_choose_2(alphabet[i] / 2);
        answer += calculate_n_choose_2(alphabet[i] / 2 + 1);
      }
    }
  }
  printf("%d\n", answer);
}
int calculate_n_choose_2(int n) { return n * (n - 1) / 2; }
