#include <bits/stdc++.h>
int dx4[] = {0, 0, -1, 1};
int dy4[] = {-1, 1, 0, 0};
bool valid(int r, int c, int x, int y) {
  if (x >= 1 && x <= r && y >= 1 && y <= c) return 1;
  return 0;
}
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  vector<int> v, v1;
  map<char, int> mp;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    mp[s[0]]++;
  }
  for (char ch = 'a'; ch <= 'z'; ch++) {
    int p = mp[ch];
    if (p == 0)
      continue;
    else {
      int x = p / 2;
      if (x != 0) {
        v.push_back(x);
        if (p % 2 == 0)
          v1.push_back(x);
        else
          v1.push_back(x + 1);
      }
    }
  }
  long long int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    int x = v[i];
    ans += (x * (x - 1)) / 2;
  }
  for (int i = 0; i < v1.size(); i++) {
    int x = v1[i];
    ans += (x * (x - 1)) / 2;
  }
  cout << ans << endl;
  return 0;
}
