#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m, i, j, a[30] = {0}, p, p1, k = 0;
  string s[200], s1;
  char ch;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s1;
    ch = s1[0];
    a[int(ch) - 97]++;
  }
  for (i = 0; i < 28; i++) {
    p = a[i] / 2;
    p1 = a[i] - p;
    k = k + p * (p - 1) / 2 + p1 * (p1 - 1) / 2;
  }
  cout << k << endl;
  return 0;
}
