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