#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void inout() {}
int main() {
  fast();
  inout();
  int n;
  cin >> n;
  map<char, int> m;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    m[s[0]]++;
  }
  long long int ans = 0;
  for (auto it : m) {
    long long int a = it.second / 2;
    if ((it.second) % 2) {
      ans += a * (a - 1) / 2;
      a++;
      ans += a * (a - 1) / 2;
    } else
      ans += a * (a - 1);
  }
  cout << ans;
  cout << "\n";
}
