#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  int a[26];
  int b[26];
  memset(a, 0, sizeof a);
  memset(b, 0, sizeof b);
  for (int i = 0; i < n; i++) {
    string name;
    cin >> name;
    if (a[name[0] - 'a'] <= b[name[0] - 'a']) {
      a[name[0] - 'a']++;
    } else {
      b[name[0] - 'a']++;
    }
  }
  long long int x = 0;
  for (int i = 0; i < 26; i++) {
    long long int temp = 1;
    if (a[i] >= 2) {
      for (int j = a[i] - 1; j <= a[i]; j++) {
        temp = temp * (long long int)j;
      }
      temp /= 2;
      x += temp;
    }
    temp = 1;
    if (b[i] >= 2) {
      for (int j = b[i] - 1; j <= b[i]; j++) {
        temp *= j;
      }
      temp /= 2;
      x += temp;
    }
  }
  std::cout << x << endl;
  return 0;
}
