module _;
void main() {
	import std.stdio, std.conv, std.string;
	int n =readln.strip.to!int;
	int[char] cnt;
	foreach(i; 0..n) {
		cnt[readln[0]]++;
	}
	int ans = 0;
	foreach(k; cnt.byKey) {
		ans += cnt[k]*(cnt[k]-1)/2;
		int half = cnt[k]/2;
		ans -= half * (cnt[k]-half);
	}
	writeln(ans);
}
