#include <bits/stdc++.h>
using namespace std;
int accept() {
  int n = 101, mx = 0, ok1, result = 0;
  int a[30] = {0};
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    a[s[0] - 'a']++;
  }
  for (int i = 0; i <= 26; i++) {
    mx = max(mx, a[i]);
  }
  if (mx % 2 == 0) {
    ok1 = mx / 2;
  } else {
    ok1 = mx / 2;
  }
  for (int i = 0; i <= 26; i++) {
    int ou1 = a[i] / 2;
    int ou2 = a[i] - ou1;
    result += (ou1 * (ou1 - 1)) / 2 + (ou2 * (ou2 - 1)) / 2;
  }
  cout << result << "\n";
  return 0;
}
int main() {
  int t = 1;
  while (t--) {
    accept();
  }
  return 0;
}
