#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  string s[n];
  map<char, int> m;
  map<string, int> p;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    m[s[i][0]]++;
  }
  for (auto it = m.begin(); it != m.end(); it++) {
    if (it->second == 3) {
      ans++;
    } else if (it->second > 3) {
      if (it->second % 2 == 0) {
        ans = ans + (it->second) * (it->second - 2) / 4;
      } else {
        int x = it->second / 2;
        int y = it->second - it->second / 2;
        ans = ans + x * (x - 1) / 2;
        ans = ans + y * (y - 1) / 2;
      }
    }
  }
  cout << ans;
  return 0;
}
