#include <bits/stdc++.h>
int main() {
  int n;
  std::string student;
  std::unordered_map<char, int> c1;
  std::unordered_map<char, int> c2;
  std::cin >> n;
  while (n--) {
    std::cin >> student;
    if (c1.find(student[0]) == c1.end()) {
      c1[student[0]] = 1;
    } else if (c2.find(student[0]) == c2.end()) {
      c2[student[0]] = 1;
    } else if (c1.at(student[0]) >= c2.at(student[0])) {
      c2[student[0]]++;
    } else {
      c1[student[0]]++;
    }
  }
  int c1_pairs = 0, c2_pairs = 0;
  for (auto it = c1.begin(); it != c1.end(); it++) {
    c1_pairs += std::round(std::tgamma(it->second + 1) /
                           (std::tgamma(it->second - 2 + 1) * std::tgamma(3)));
  }
  for (auto it = c2.begin(); it != c2.end(); it++) {
    c2_pairs += std::round(std::tgamma(it->second + 1) /
                           (std::tgamma(it->second - 2 + 1) * std::tgamma(3)));
  }
  std::cout << (c1_pairs + c2_pairs) << std::endl;
}
