import java.math.BigDecimal

fun main(args: Array<String>) {
    abc089c()
}

fun abc089c() {
    val n = readLine()!!.toInt()
    val initials = (1..n).map { readLine()!![0] }

    val march = arrayOf('M', 'A', 'R', 'C', 'H')

    val marchCounts = march.map { m ->
        BigDecimal(initials.count { it == m })
    }

    val patterns = (0..4).map { i ->
        (i + 1..4).map { j ->
            (j + 1..4).map { k ->
                marchCounts[i] * marchCounts[j] * marchCounts[k]
            }
        }.flatten()
    }.flatten()

    val answer = patterns.fold(BigDecimal.ZERO, BigDecimal::add)

    println(answer)
}
