#include <bits/stdc++.h>
using namespace std;
bool isPal(string s) {
  for (long long int i = 0; i < s.length() / 2; i++)
    if (s[i] != s[s.length() - 1 - i]) return false;
  return true;
}
int main() {
  long long int n;
  cin >> n;
  long long int arr[26] = {0};
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    arr[s[0] - 97]++;
  }
  long long int c = 0;
  for (long long int i = 0; i < 26; i++) {
    long long int key, k1, k2;
    key = arr[i];
    if (key == 0) continue;
    k1 = key / 2;
    k2 = key - k1;
    c += ((k1) * (k1 - 1)) / 2 + ((k2) * (k2 - 1)) / 2;
  }
  cout << c << endl;
  return 0;
}
