#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  string s;
  map<char, long long> m;
  while (n--) {
    cin >> s;
    m[s[0]]++;
  }
  long long sum = 0;
  for (auto x : m) {
    long long p = x.second;
    long long h = p / 2;
    sum += (h * (h - 1)) / 2;
    if (p % 2 == 1)
      sum += (h * (h + 1)) / 2;
    else
      sum += (h * (h - 1)) / 2;
  }
  cout << sum << endl;
}
