#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
int n;
char s[N][30];
char w[2020];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
    w[s[i][1]]++;
  }
  int res = 0;
  for (int i = 'a'; i <= 'z'; ++i) {
    int s1 = w[i] / 2;
    int s2 = w[i] - s1;
    res += (s1 * (s1 - 1) / 2) + (s2 * (s2 - 1) / 2);
  }
  cout << res << "\n";
}
