#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  map<char, int> freq;
  int n;
  cin >> n;
  while (n--) {
    string palabra;
    cin >> palabra;
    freq[palabra[0]]++;
  }
  int ans = 0;
  for (map<char, int>::iterator l = freq.begin(); l != freq.end(); ++l) {
    int n1, n2;
    if (l->second % 2 == 0) {
      n1 = l->second / 2;
      n2 = l->second / 2;
    } else {
      n1 = l->second / 2;
      n2 = (l->second / 2) + 1;
    }
    ans += (n1 * (n1 - 1)) / 2;
    ans += (n2 * (n2 - 1)) / 2;
  }
  cout << ans;
  return 0;
}
