#include <bits/stdc++.h>
using namespace std;
int calcPairs(int count);
int main() {
  int n, i, arr[100];
  cin >> n;
  string str[n];
  for (i = 0; i < n; i++) {
    cin >> str[i];
    arr[i] = str[i][0];
  }
  sort(arr, arr + n);
  int count = 1, countPair = 0;
  for (i = 1; i < n; i++) {
    if (arr[i] == arr[i - 1]) {
      count++;
    } else {
      countPair += calcPairs(count);
      count = 1;
    }
  }
  if (count != 1) countPair += calcPairs(count);
  cout << countPair;
  return 0;
}
int calcPairs(int count) {
  int countPair = 0;
  if (count == 1 || count == 2)
    ;
  else if (count == 3)
    countPair += 1;
  else if (count % 2 == 0) {
    count = count / 2;
    countPair += 2 * (count * (count - 1) / 2);
  } else {
    int temp = count / 2;
    count -= temp;
    countPair += count * (count - 1) / 2 + temp * (temp - 1) / 2;
  }
  return countPair;
}
