#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<char, int> p;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    p[s[0]]++;
  }
  int ans = 0;
  int a, b;
  map<char, int>::iterator it;
  for (it = p.begin(); it != p.end(); it++) {
    a = (it->second / 2);
    b = it->second - a;
    ans += (a * (a - 1)) / 2;
    ans += (b * (b - 1)) / 2;
  }
  cout << ans;
  return 0;
}
