function Main(input) {
	input = input.split("\n");
	var N = parseInt(input[0]);
	var M = new Array(5).fill(0);
	for(var i = 0; i < N; i++){
		switch(input[i+1][0]){
			case "M":
				M[0]++;
				break;
			case "A":
				M[1]++;
				break;
			case "R":
				M[2]++;
				break;
			case "C":
				M[3]++;
				break;
			case "H":
				M[4]++;
				break;
		}
	}
	var ans = 0;
	for(i = 0; i < 3; i++){
		for(var j = i+1; j < 4; j++){
			for(var k = j+1; k < 5; k++){
				ans += M[i] * M[j] * M[k];
			}
		}
	}
	console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));