#include <bits/stdc++.h>
using namespace std;
int fun(int x) { return (x * (x - 1)) / 2; }
int main() {
  int n, i, a[26], res, x, y;
  string st;
  for (i = 0; i < 26; i++) a[i] = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> st;
    a[st[0] - 97]++;
  }
  res = 0;
  for (i = 0; i < 26; i++) {
    if (a[i]) {
      x = a[i] / 2;
      y = a[i] - x;
      res += fun(x) + fun(y);
    }
  }
  cout << res << endl;
}
