#include <bits/stdc++.h>
using namespace std;
int n, cnt[30], ans;
string s;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    cnt[s[0] - 'a']++;
  }
  for (int i = 0; i <= 'z' - 'a'; i++) {
    int a = cnt[i] / 2;
    int b = cnt[i] - a;
    ans += (a * (a - 1));
    ans += (b * (b - 1));
  }
  cout << ans / 2;
  return 0;
}
