#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5, mod = 1e9 + 7, inf = 1e9 + 7;
long long n, ans;
long long a[26];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[s[0] - 'a']++;
  }
  for (long long i = 0; i < 26; i++) {
    long long t = a[i] / 2, u = a[i] - t;
    ans += t * (t - 1) / 2 + u * (u - 1) / 2;
  }
  cout << ans;
}
