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