#include <bits/stdc++.h>
using namespace std;
int n, ans = 0, c[30];
string s;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    c[int(s[0]) - 96]++;
  }
  for (int i = 1; i <= 27; i++) {
    int m = c[i];
    ans += m / 2 * (m / 2 - 1) / 2 + (m / 2 + m % 2) * (m / 2 + m % 2 - 1) / 2;
  }
  cout << ans;
  return 0;
}
