#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  map<char, int> d;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    d[s[0]]++;
  }
  int ans = 0;
  for (auto x : d) {
    int h = x.second / 2;
    int h2 = x.second - h;
    ans = ans + h * (h - 1) / 2 + h2 * (h2 - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
