#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, x, y, ans;
  cin >> n;
  string s;
  int ch[26] = {0};
  for (int i = 0; i < n; i++) {
    cin >> s;
    ch[s[0] - 'a']++;
  }
  ans = 0;
  for (int i = 0; i < 26; i++) {
    if (ch[i] > 0) {
      x = ch[i] / 2, y = ch[i] - x;
      ans += ((ch[i] * ch[i]) - ch[i] - (2 * x * y)) / 2;
    }
  }
  cout << ans << endl;
}
