#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int mass[26];
  memset(mass, 0, sizeof(mass));
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mass[s[0] - 'a']++;
  }
  int c = 0;
  for (int i = 0; i < 26; i++) {
    if (mass[i] < 2) continue;
    c += (mass[i] / 2) * (mass[i] / 2 - 1) / 2;
    c += (mass[i] - mass[i] / 2) * (mass[i] - mass[i] / 2 - 1) / 2;
  }
  cout << c;
}
