#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n;
  x = 0;
  string array[n];
  for (int i = 0; i < n; i++) {
    cin >> array[i];
  }
  for (int a = 0; a < 26; a++) {
    int temp = 0;
    string s;
    for (int i = 0; i < n; i++) {
      s = array[i];
      if (toupper(s[0]) == toupper('a' + a)) {
        temp++;
      }
    }
    if (temp % 2 == 0)
      x += temp / 2 * (temp / 2 - 1);
    else
      x += (temp / 2 + 1) * (temp / 2) / 2 + (temp / 2) * (temp / 2 - 1) / 2;
  }
  cout << x;
  return 0;
}
