#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, ans = 0;
  long long int c[30] = {0};
  cin >> n;
  string name;
  for (long long int i = 0; i < n; ++i) {
    cin >> name;
    c[name[0] - 'a']++;
  }
  for (long long int i = 0; i < 26; ++i) {
    long long int a = c[i] / 2, b = c[i] - c[i] / 2;
    ans += a * (a - 1) / 2;
    ans += b * (b - 1) / 2;
  }
  cout << ans << endl;
}
