#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  string name[n];
  for (i = 0; i < n; i++) cin >> name[i];
  int alphabet[26] = {0};
  for (i = 0; i < n; i++) alphabet[name[i][0] - 97]++;
  long long sum = 0;
  for (i = 0; i < 26; i++) {
    int x, y;
    if (alphabet[i] % 2 == 0) {
      x = y = alphabet[i] / 2;
    } else {
      x = alphabet[i] / 2 + 1;
      y = alphabet[i] - x;
    }
    sum = sum + x * (x - 1) / 2 + y * (y - 1) / 2;
  }
  cout << sum << "\n";
}
