#include <bits/stdc++.h>
using namespace std;
long long int temp(long long int t) {
  t--;
  long long int ans = 0;
  while (t) {
    ans += t;
    t--;
  }
  return ans;
}
int n, book[100], ans = 0;
string s[110];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  for (int i = 1; i <= n; i++) book[s[i][0] - 'a']++;
  for (int i = 0; i < 26; i++) {
    if (book[i] > 2) {
      int a = book[i] / 2;
      int b = book[i] - a;
      if (a > 1) ans += temp(a);
      if (b > 1) ans += temp(b);
    }
  }
  cout << ans << endl;
  return 0;
}
