#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return (b ? __gcd(a, b) : a);
}
template <typename T>
T lcm(T a, T b) {
  return (a * (b / gcd(a, b)));
}
template <typename T>
T isprime(T a) {
  for (long long int i = 2; i * i <= a; i++)
    if (a % i == 0) return 0;
  return 1;
}
bool compare(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first - a.second < b.first - b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, cnt1[27] = {0}, cnt2[27] = {0};
  char name[100];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> name;
    if (cnt1[name[0] - 'a'] < cnt2[name[0] - 'a'])
      cnt1[name[0] - 'a']++;
    else
      cnt2[name[0] - 'a']++;
  }
  long long int tot = 0;
  for (int i = 0; i < 27; ++i) {
    if (cnt1[i] > 1) tot += cnt1[i] * (cnt1[i] - 1) / 2;
    if (cnt2[i] > 1) tot += cnt2[i] * (cnt2[i] - 1) / 2;
  }
  cout << tot;
}
