#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9;
int main() {
  int n;
  cin >> n;
  vector<int> a(27, 0);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[s[0] - 96]++;
  }
  int ans = 0;
  for (int i = 0; i < 27; i++) {
    int m1 = a[i] / 2;
    int m2 = a[i] - m1;
    ans += (m1 * (m1 - 1) / 2);
    ans += (m2 * (m2 - 1) / 2);
  }
  cout << ans << endl;
  return 0;
}
