#include <bits/stdc++.h>
using namespace std;
bool cmp(long long int x, long long int y) { return x > y; }
bool comp(pair<long long int, long long int> a,
          pair<long long int, long long int> b) {
  return a.first + a.second > b.first + b.second;
}
long long int min(long long int a, long long int b) {
  if (a >= b)
    return b;
  else
    return a;
}
long long int max(long long int a, long long int b) {
  if (a >= b)
    return a;
  else
    return b;
}
long long int ndig(long long int n) {
  long long int l = 0;
  while (n > 0) {
    n /= 10;
    l++;
  }
  return l;
}
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
long long int gcd(long long int x, long long int y) {
  long long int a, b, t, gcd, lcm;
  a = x;
  b = y;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  gcd = a;
  return gcd;
}
long long int lcm(long long int x, long long int y) {
  long long int a, b, t, gcd, lcm;
  a = x;
  b = y;
  while (b != 0) {
    t = b;
    b = a % b;
    a = t;
  }
  gcd = a;
  lcm = (x * y) / gcd;
  return lcm;
}
long long int cntdiv(long long int n) {
  long long int cnt = 0;
  for (long long int i = 1; i <= sqrt(n); i++) {
    if (n % i == 0) {
      if (n / i == i)
        cnt++;
      else
        cnt = cnt + 2;
    }
  }
  return cnt;
}
void solve() {
  long long int n;
  cin >> n;
  long long int a[26];
  memset(a, 0, sizeof(a));
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    a[(s[0]) - 97]++;
  }
  long long int ans = 0;
  for (long long int i = 0; i < 26; i++) {
    if (a[i] > 2) {
      long long int x = floor(a[i] / 2.0);
      long long int y = a[i] - x;
      ans += (x * (x - 1) / 2) + (y * (y - 1) / 2);
    }
  }
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int TEST = 1;
  while (TEST--) {
    solve();
  }
}
