#include <bits/stdc++.h>
using namespace std;
int fact(int n);
int ncr(int n) { return (n * (n - 1)) / 2; }
int main() {
  int n;
  cin >> n;
  int fr[26] = {0};
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    fr[int(temp[0]) - 97]++;
  }
  int count = 0;
  for (int i = 0; i < 26; i++) {
    if (fr[i] > 2) {
      int x = (fr[i] / 2) + (fr[i] % 2);
      int y = fr[i] - x;
      count += ncr(x) + ncr(y);
    }
  }
  cout << count << endl;
}
