#include <bits/stdc++.h>
using namespace std;
template <typename type>
type __lcm(type n1, type n2) {
  return n1 * (n2 / __gcd(n1, n2));
}
long long nCr(int n, int r) {
  if (n < r) return 0;
  if (n == r) return 1;
  if (r == 1) return n;
  int f1 = r, f2 = n - r;
  if (f2 > f1) swap(f2, f1);
  long long result = 1;
  for (int i = 1; i <= f2; i++) {
    result *= (i + f1);
    result /= i;
  }
  return result;
}
long long nPr(int n, int r, long long mod = 0) {
  if (n < r) return 0;
  if (r == 1) return n;
  long long result = 1;
  for (int i = n - r + 1; i <= n; i++) {
    result *= i;
    if (mod) result %= mod;
  }
  return result;
}
long long factorial(int n, long long modulo = 0) {
  if (n == 0) return 1;
  if (modulo)
    return (n * factorial(n - 1)) % modulo;
  else
    return n * factorial(n - 1);
}
void io_txt() {}
void f();
int main() {
  int t = 1;
  for (int itr = (1); itr <= (t); itr++) {
    f();
  }
}
void f() {
  int n;
  cin >> n;
  string s[n];
  map<char, int> fm;
  for (int itr = 0; itr < (n); itr++) {
    cin >> s[itr];
    fm[s[itr][0]]++;
  }
  int ans = 0;
  for (map<char, int>::iterator it = fm.begin(); it != fm.end(); it++) {
    int p1 = (it->second / 2);
    int p2 = (it->second - p1);
    p1 = nCr(p1, 2);
    p2 = nCr(p2, 2);
    ans += (p1 + p2);
  }
  cout << ans;
}
