import std.stdio, std.conv, std.string;

void main() {
	int N = readln().chomp().to!(int);
	long [256] cnt;
	foreach(i; 0..256) cnt[i] = 0;
	foreach(i; 0..N) {
		string S;
		S = readln();
		cnt[S[0]]++;
	}

	long res = 0;
	string m = "MARCH";
	foreach(i; 0..5) {
		foreach(j; (i+1)..5) {
			foreach(k; (j+1)..5) {
				res += cnt[m[i]] * cnt[m[j]] * cnt[m[k]];
			}
		}
	}
	writeln(res);
}
