#include <bits/stdc++.h>
using namespace std;
int str(int n) {
  int sum1 = 0;
  if (n > 1) {
    for (int i = 1; i < n; i++) sum1 += i;
    return sum1;
  } else
    return 0;
}
int main() {
  int n;
  string s[105];
  while (cin >> n) {
    int sum = 0;
    map<int, int> mp;
    for (int i = 0; i < n; i++) {
      cin >> s[i];
      mp[s[i][0] - 'a']++;
    }
    for (int i = 0; i <= 25; i++) {
      int a = mp[i] / 2;
      int b = mp[i] - a;
      sum += (str(a) + str(b));
    }
    cout << sum << endl;
  }
  return 0;
}
