#include <bits/stdc++.h>
int main() {
  std::vector<int> names(256, 0);
  std::string s;
  int n;
  std::cin >> n;
  while (std::cin >> s) {
    names[(unsigned char)s[0]]++;
  }
  unsigned long long ans = 0;
  for (int i = 0; i < 256; ++i) {
    int p = names[i] / 2;
    ans += p * (p - 1) / 2 + (names[i] - p) * (names[i] - p - 1) / 2;
  }
  std::cout << ans;
}
