#include <bits/stdc++.h>
using namespace std;
const long long inf = 0x7f7f7f7f;
int GCD(int a, int b) { return 0 == b ? a : GCD(b, a % b); }
const long long mod = 1e9 + 7;
const double pi = acos(-1);
int main() {
  int n;
  cin >> n;
  string str[200];
  map<char, int> q;
  for (int i = 0; i < n; i++) cin >> str[i], q[str[i][0]]++;
  map<char, int>::iterator iter;
  int ans = 0;
  for (iter = q.begin(); iter != q.end(); iter++) {
    int a = iter->second;
    if (a == 3) {
      ans++;
      continue;
    }
    if (a <= 2) continue;
    ans += (a / 2) * (a / 2 - 1) / 2;
    ans += (a - a / 2) * (a - a / 2 - 1) / 2;
  }
  cout << ans << endl;
}
