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