#include <bits/stdc++.h>
const long long maxn = 1e6 + 5;
const long long mod = 1e9 + 7;
const long long base = 1331;
using namespace std;
long long n;
long long a[maxn];
void read(void) {
  cin >> n;
  for (long long i = 1; i <= (long long)(n); ++i) {
    string s;
    cin >> s;
    a[s[0]]++;
  }
  long long ans = 0;
  for (long long i = 'a'; i <= 'z'; ++i) {
    if (a[i] <= 2) continue;
    ans += a[i] * (a[i] - 1) - 2 * (a[i] / 2) * ((a[i] / 2 + a[i] % 2));
  }
  cout << ans / 2;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(0);
  read();
}
