#include <bits/stdc++.h>
using namespace std;
long long aaaa, aaaaa, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s,
    t, u, v, w, x, y, z, sum, maxi, maxj, mini, minj;
long long aa[100007], aaa[100007], bb[100007];
string s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;
char c1, c2, c3, c4, c5, c6, c7, c8, c9, c0;
long double d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, dd;
queue<long long> qu;
vector<long long> ve, ve2;
stack<long long> st;
set<string> se;
map<string, long long> ma;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> s1;
    k = s1[0] - 'a' + 1;
    aa[k]++;
  }
  k = 0;
  for (i = 1; i <= 26; i++) {
    p = aa[i] / 2;
    r = aa[i] - p;
    k += p * (p - 1) / 2 + r * (r - 1) / 2;
  }
  cout << k << endl;
  return 0;
}
