fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val S = mutableListOf<String>()
    (1..N).forEach {
        S.add(readLine()!!)
    }

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

    // O(N * 5)
    val sizes = march.map {char ->
        S.filter { it[0] == char }.size.toLong()
    }

    var answer = 0L
    // Each combination
    (0..4).forEach { i ->
        (i..4).forEach { j ->
            (j..4).forEach { k ->
                if(i != j && j != k) {
                    answer += sizes[i] * sizes[j] * sizes[k]
                }
            }
        }
    }
    println(answer)
}