import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;

void main()
{
	auto input = split(readln());
	auto N = to!int(input[0]);
	long aM, aA, aR, aC, aH; // the number of the names that starts with ...
	foreach(i; 0..N) {
		auto S = split(readln())[0];
		aM += (S[0] == 'M'? 1 : 0);
		aA += (S[0] == 'A'? 1 : 0);
		aR += (S[0] == 'R'? 1 : 0);
		aC += (S[0] == 'C'? 1 : 0);
		aH += (S[0] == 'H'? 1 : 0);
	}
	writeln( aM*aA*(aR+aC+aH) + aM*aR*(aC+aH) + aM*aC*aH + aA*aR*(aC+aH) + aA*aC*aH + aR*aC*aH );
	
}