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