#include <bits/stdc++.h>
using namespace std;
int arr[30];
int main() {
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    ++arr[(int)(s[0]) - (int)('a')];
  }
  int total = 0;
  for (int i = 0; i < 26; ++i) {
    int p1 = arr[i] / 2;
    int p2 = arr[i] - p1;
    total = total + (((p1 - 1) * p1) / 2) + (((p2 - 1) * p2) / 2);
  }
  cout << total << endl;
}
