
fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val ss = (1..N).map { readLine()!! }
    val march = "MARCH".toCharArray()

    val counts: Map<Char, Int> = march.associateBy({it}, { ss.count {x -> x[0]==it} })
    val ans: Long = arrayOf(
            "MAR",
            "MAC",
            "MAH",
            "MRC",
            "MRH",
            "MCH",
            "ARC",
            "ARH",
            "ACH",
            "RCH"
    ).map {
        val init: Long = 1
        it.map { x -> counts[x] }.fold(init) { x,y -> x * (y ?: 1) }
    }.sum()
    println(ans)
}