#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int A = 26;
vector<string> a[A];
int main() {
  int n;
  cin >> n;
  string s;
  while (n--) {
    cin >> s;
    a[(int)(s[0] - 'a')].push_back(s);
  }
  int ans = 0;
  for (int c = 0; c < A; c++) {
    int z = (int)a[c].size();
    int x = z / 2;
    z -= x;
    ans += x * (x - 1) / 2 + z * (z - 1) / 2;
  }
  cout << ans << endl;
  return 0;
}
