#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, i, m[123] = {0}, s = 0, k;
  char n[21];
  cin >> x;
  for (i = 0; i < x; i++) {
    cin >> n;
    m[n[0]]++;
  }
  for (i = 97; i < 123; i++) {
    if (m[i] <= 1)
      continue;
    else if (m[i] % 2 == 0) {
      k = m[i] / 2;
      s = s + k * (k - 1);
    } else {
      k = m[i] / 2;
      s = s + (k * (k - 1)) / 2;
      k++;
      s = s + (k * (k - 1)) / 2;
    }
  }
  cout << s;
}
