#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  int f[27] = {};
  while (n--) {
    char s[21];
    scanf("%s", s);
    ++f[s[0] - 'a' + 1];
  }
  for (int i = 1; i <= 26; ++i) {
    if (f[i] > 2) {
      if (f[i] % 2) {
        n = f[i] / 2;
        ans += (n * (n - 1)) / 2;
        ans += (n * (n + 1)) / 2;
      } else {
        n = f[i] / 2;
        ans += (n * (n - 1)) / 2;
        ans += (n * (n - 1)) / 2;
      }
    }
  }
  printf("%d", ans);
  return 0;
}
