#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long arr[26] = {0}, brr[26] = {0};
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    if (arr[s[0] - 'a'] < brr[s[0] - 'a']) {
      arr[s[0] - 'a']++;
    } else
      brr[s[0] - 'a']++;
  }
  long long ans = 0;
  for (long long i = 0; i < 26; i++) {
    ans += (arr[i] * (arr[i] - 1)) / 2;
    ans += (brr[i] * (brr[i] - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
