#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i;
  cin >> n;
  vector<string> v;
  long long int c[26] = {0};
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    long long int y;
    v.push_back(s);
    y = v[i][0];
    if (y >= 97 && y <= 122) c[y - 97]++;
  }
  long long int t = 0;
  for (i = 0; i < 26; i++) {
    if (c[i] % 2 == 0)
      t = t + (c[i] * (c[i] - 2)) / 4;
    else {
      int x = (c[i] / 2) + 1;
      int y = c[i] / 2;
      t = t + ((y * (y - 1)) / 2) + x * (x - 1) / 2;
    }
  }
  cout << t << endl;
  return 0;
}
