#include <bits/stdc++.h>
using namespace std;
constexpr auto PI = 3.14159265358979323846L;
constexpr auto oo = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
int main() {
  int n;
  cin >> n;
  int c[26] = {0};
  string s;
  int p = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    c[s[0] - 'a']++;
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    int k = c[i] / 2;
    int l = c[i] - k;
    ans += k * (k - 1) / 2;
    ans += l * (l - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
