#include <bits/stdc++.h>
using namespace std;
int ara[30];
int findx(int x) { return x * (x - 1) / 2; }
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    ara[str[0] - 'a']++;
  }
  int sum = 0;
  for (int i = 0; i < 27; i++) {
    if (ara[i] > 2) {
      int a = ara[i] / 2;
      int b = a + ara[i] % 2;
      sum += findx(a) + findx(b);
    }
  }
  printf("%d\n", sum);
}
