#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[26];
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    arr[x[0] - 'a']++;
  }
  int result = 0;
  for (int i = 0; i < 26; i++) {
    if (arr[i] <= 1) {
      continue;
    }
    if (arr[i] % 2 == 1) {
      result += ((arr[i] / 2 + 1) * (arr[i] / 2)) / 2 +
                ((arr[i] / 2) * (arr[i] / 2 - 1)) / 2;
    } else {
      result += ((arr[i] / 2) * (arr[i] / 2 - 1));
    }
  }
  cout << result << endl;
}
