#include <bits/stdc++.h>
using namespace std;
char aa[26];
int main() {
  long long m;
  cin >> m;
  long long result = 0;
  for (long long i = 0; i < m; ++i) {
    string a;
    cin >> a;
    aa[a[0] - 'a']++;
    if ((aa[a[0] - 'a'] + 1) / 2 > 1) {
      result += (aa[a[0] - 'a'] + 1) / 2 - 1;
    }
  }
  cout << result;
  return 0;
}
