fun main(args: Array<String>) {
    val n = readInt()
    val s = List(n) { readString() }

    val m = s.filter { it[0] == 'M' }.size.toLong()
    val a = s.filter { it[0] == 'A' }.size.toLong()
    val r = s.filter { it[0] == 'R' }.size.toLong()
    val c = s.filter { it[0] == 'C' }.size.toLong()
    val h = s.filter { it[0] == 'H' }.size.toLong()

    val ans =
        m * a * r + m * a * c + m * a * h + m * r * c + m * r * h + m * c * h + a * r * c + a * r * h + a * c * h + r * c * h
    println(ans)
}

// read
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()