#include <bits/stdc++.h>
using namespace std;
int id[300];
int main() {
  int n;
  cin >> n;
  vector<int> f(26);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    f[s[0] - 'a']++;
  }
  int ans = 0;
  for (int t : f) {
    int m = t / 2;
    ans += m * (m - 1) / 2;
    m = t - m;
    ans += m * (m - 1) / 2;
  }
  cout << ans << endl;
}
