#include <bits/stdc++.h>
using namespace std;
int fact(int n);
int nCr(int n, int r) { return fact(n) / (fact(r) * fact(n - r)); }
int fact(int n) {
  int res = 1;
  for (int i = 2; i <= n; i++) res = res * i;
  return res;
}
int main() {
  long long int n, ans = 0;
  cin >> n;
  long long int arr[107];
  map<long long int, long long int> m;
  for (long long int i = 0; i < 26; i++) {
    m[i] = 0;
  }
  for (long long int i = 0; i < n; i++) {
    string str;
    cin >> str;
    arr[i] = str[0];
    m[str[0] - 'a']++;
  }
  for (long long int i = 0; i < 26; i++) {
    long long int c;
    c = m[i];
    if (c > 2) {
      long long int a = c / 2;
      long long int b = c - c / 2;
      if (a >= 2) ans += (a * (a - 1)) / 2;
      if (b >= 2) ans += (b * (b - 1)) / 2;
    }
  }
  cout << ans;
  return 0;
}
