#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(T& x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
const int N = 26 + 10;
int n, i, ans, cnt[N];
char s[100000];
int main() {
  read(n);
  for (i = 1; i <= n; ++i) scanf("%s", s + 1), cnt[s[1] - 'a']++;
  for (i = 0; i < 26; ++i)
    if (cnt[i]) {
      int A = cnt[i] / 2;
      int B = cnt[i] - A;
      ans += A * (A - 1) / 2, ans += B * (B - 1) / 2;
    }
  printf("%d\n", ans);
  return 0;
}
