#include <bits/stdc++.h>
using namespace std;
int binomialCoeff(int n, int k) {
  if (k == 0 || k == n) return 1;
  return binomialCoeff(n - 1, k - 1) + binomialCoeff(n - 1, k);
}
int fact(int n) { return (n == 1 || n == 0) ? 1 : n * fact(n - 1); }
int main() {
  int n, m;
  cin >> n;
  int i, c[26] = {0};
  string s;
  for (i = 0; i < n; i++) {
    getline(cin, s);
    if (s.length() == 0) {
      while (s.length() == 0) getline(cin, s);
    }
    m = int(s[0]) - int('a');
    c[m]++;
  }
  int sum = 0;
  for (i = 0; i < 26; i++) {
    if (c[i] > 1) {
      int d = c[i] / 2;
      int e = c[i] - d;
      int f = 0, g = 0;
      if (e > 1) {
        f = binomialCoeff(e, 2);
      }
      if (d > 1) {
        g = binomialCoeff(d, 2);
      }
      sum = sum + f + g;
    }
  }
  cout << sum;
  return 0;
}
