#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<char, long long> m1;
  string s;
  while (n--) {
    cin >> s;
    m1[s[0]]++;
  }
  long long ans = 0;
  for (auto &x : m1) {
    if (x.second > 2) {
      long long temp = x.second / 2 + (x.second % 2 != 0);
      long long temp2 = x.second / 2;
      ans += ((temp * (temp - 1)) / 2 + (temp2 * (temp2 - 1)) / 2);
    }
  }
  cout << ans;
  return 0;
}
