import std.stdio, std.conv, std.string;
import std.algorithm, std.array, std.container;
import std.numeric, std.math;
import core.bitop;

T RD(T = string)() { static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }

long mod = pow(10, 9) + 7;
long moda(long x, long y) { return (x + y) % mod; }
long mods(long x, long y) { return ((x + mod) - (y % mod)) % mod; }
long modm(long x, long y) { return (x * y) % mod; }

void main()
{
	auto N = RD!long;
	
	long[char] cnt;
	cnt['M'] = 0;
	cnt['A'] = 0;
	cnt['R'] = 0;
	cnt['C'] = 0;
	cnt['H'] = 0;

	foreach (i; 0..N)
	{
		auto name = RD;
		auto c = cnt.get(name[0], -1);
		if (c != -1) ++cnt[name[0]];
	}
	long ans = 0;
	auto keys = cnt.keys;
	foreach (i; 0..5)
	{
		foreach (j; i+1..5)
		{
			foreach (k; j+1..5)
			{
				ans += cnt[keys[i]] * cnt[keys[j]] * cnt[keys[k]];
			}
		}
	}

	writeln(ans);
	stdout.flush();
}