function Main(input) {
	input = input.split("\n")
	var namesN = input[0]
	var names = input.slice(1, namesN)
	var nameInitialCounts = {}
	for(var name in names) {
		nameInitialCounts[name.charAt(0)]
			= ++nameInitialCounts[name.charAt(0)] || 0
	}
	var cases = allPossibleCases(["M", "A", "R", "C", "H"]).filter(function(e, i, a) {
		return e.length == 3
	})
	var result = 0
	for(var case in cases) {
		result += nameInitialCounts[case[0]] * nameInitialCounts[case[1]] * nameInitialCounts[case[2]]
	}
	console.log(result)
}

function allPossibleCases(arr) {
  if (arr.length == 1) {
    return arr[0];
  } else {
    var result = [];
    var allCasesOfRest = allPossibleCases(arr.slice(1));  // recur with the rest of array
    for (var i = 0; i < allCasesOfRest.length; i++) {
      for (var j = 0; j < arr[0].length; j++) {
        result.push(arr[0][j] + allCasesOfRest[i]);
      }
    }
    return result;
  }

}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));