#include <bits/stdc++.h>
using namespace std;
int combination(int n) {
  int ans;
  ans = (n * (n - 1)) / 2;
  return ans;
}
int main() {
  int n, cnt;
  int a[100000] = {0};
  string str;
  cin >> n;
  while (n--) {
    cin >> str;
    a[str[0] - 'a']++;
  }
  int sum = 0, data;
  for (int i = 0; i < 26; i++) {
    if (a[i] >= 2) {
      data = a[i] - (a[i] / 2);
      sum += combination(data) + combination(a[i] / 2);
    }
  }
  cout << sum << endl;
  return 0;
}
