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