#include <bits/stdc++.h>
const int N = 100 + 100;
const int M = 1e5 + 100;
const double EPS = 1e-9;
using namespace std;
int a[30], n;
char s[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    a[s[1] - 'a']++;
  }
  long long ans = 0;
  for (int i = 0; i <= 25; i++) {
    long long ct1 = (a[i] + 1) / 2;
    long long ct2 = (long long)a[i] - ct1;
    ans += ct1 * (ct1 - 1) / 2;
    ans += ct2 * (ct2 - 1) / 2;
  }
  printf("%lld\n", ans);
  return 0;
}
