#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[26] = {0};
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    arr[s[0] - 97]++;
  }
  long long ans = 0;
  for (long long i = 0; i < 26; i++) {
    if (arr[i] > 2) {
      long long f = arr[i] / 2;
      long long se = arr[i] - f;
      long long fc = (f * (f - 1)) / 2;
      long long sc = (se * (se - 1)) / 2;
      ans += fc;
      ans += sc;
    }
  }
  cout << ans << "\n";
  return 0;
}
