#include <bits/stdc++.h>
using namespace std;
int n, v[30], c[110];
string s;
int main() {
  cin >> n;
  cin.ignore();
  for (int i = 0; i < n; i++) {
    cin >> s;
    v[(int)(s[0] - 'a')]++;
  }
  c[1] = 0;
  for (int i = 2; i <= 100; i++) {
    c[i] = c[i - 1] + i - 1;
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    int spt = v[i] / 2;
    ans += c[spt] + c[v[i] - spt];
  }
  cout << ans << endl;
  return 0;
}
