#include <bits/stdc++.h>
using namespace std;
const int MAXx = 26 + 5;
int n, ar[MAXx];
long long ans;
long long comb(int a) { return (long long)a * (a - 1) / 2LL; }
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    ar[s[0] - 'a']++;
  }
  for (int i = 0; i < MAXx; i++) {
    ans += comb((ar[i] + 1) / 2) + comb(ar[i] / 2);
  }
  cout << ans;
}
