#include <bits/stdc++.h>
using std::sort;
template <class T>
inline void read(T &x) {
  T f = 1;
  x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = (x << 1) + (x << 3) + (s & 15);
    s = getchar();
  }
  x *= f;
}
template <class T>
inline T max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T min(T a, T b) {
  return a < b ? a : b;
}
int n, cnt[27], ans, a, b;
char s[101];
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", &s);
    cnt[s[0] - 'a' + 1]++;
  }
  for (int i = 1; i <= 26; i++) {
    if (cnt[i] <= 2) continue;
    if (cnt[i] % 2 == 0) {
      a = cnt[i] / 2;
      ans = ans + a * (a - 1);
    } else {
      a = (cnt[i] + 1) / 2;
      b = cnt[i] / 2;
      ans = ans + (a * (a - 1)) / 2 + (b * (b - 1)) / 2;
    }
  }
  printf("%d", ans);
}
