#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, a, b, i;
  cin >> n;
  string s[n];
  int freq[26] = {0};
  int x;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    x = (s[i][0] - 'a');
    freq[x]++;
  }
  for (i = 0; i < 26; i++) {
    if (freq[i] > 0) {
      if (freq[i] % 2 == 0) {
        a = b = freq[i] / 2;
        if (a >= 2) {
          c += (a * (a - 1));
        }
      } else {
        a = freq[i] / 2;
        b = (freq[i] + 1) / 2;
        if (a >= 2 || b >= 2) {
          c += (a * (a - 1)) / 2;
          c += (b * (b - 1)) / 2;
        }
      }
    }
  }
  cout << c;
}
