#include <bits/stdc++.h>
using namespace std;
int v[27];
int main() {
  int n, nr = 0, jumatate;
  char nume[21];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> nume;
    v[nume[0] - 'a']++;
  }
  for (int i = 0; i <= 26; i++) {
    if (v[i] != 0) {
      jumatate = v[i] / 2;
      nr = nr + (jumatate * (jumatate - 1)) / 2;
      jumatate = v[i] - jumatate;
      nr = nr + (jumatate * (jumatate - 1)) / 2;
    }
  }
  cout << nr;
  return 0;
}
