#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  float freq[26] = {0};
  long long int temp = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    freq[(int)s[0] - 97]++;
  }
  for (int j = 0; j < 26; j++) {
    if (freq[j] >= 3) {
      temp = temp + ((floor(freq[j] / 2) * (floor(freq[j] / 2) - 1)) / 2) +
             ((ceil(freq[j] / 2) * (ceil(freq[j] / 2) - 1)) / 2);
    }
  }
  cout << temp;
  return 0;
}
