#include <bits/stdc++.h>
using namespace std;
int fun(int a) {
  a = a * (a - 1) / 2;
  return a;
}
int main() {
  int countt = 0;
  int n;
  int num[26] = {};
  char arr[21];
  cin >> n;
  for (int p = 0; p < n; p++) {
    cin >> arr;
    num[int(arr[0]) - 97]++;
  }
  for (int i = 0; i < 26; i++) {
    if (num[i] % 2) {
      countt += fun((num[i] + 1) / 2);
      countt += fun((num[i] - 1) / 2);
    } else
      countt += fun(num[i] / 2) * 2;
  }
  cout << countt << endl;
}
