fun main(args: Array<String>) {
    val N = nextInt()
    val S = Array(N) { next() }
    val a = LongArray(26)
    repeat(N) { a[S[it][0] - 'A'] += 1 }
    val c = "MARCH".map { a[it - 'A'] }
    var ans = 0L
    for (i in 0 until 3)
    for (j in i + 1 until 4)
    for (k in j + 1 until 5)
        ans += c[i] * c[j] * c[k]
    println(ans)
}
fun next() = readLine()!!
fun nextInt() = Integer.parseInt(next())
fun nextInt(offset: Int = 0) = nextInt() + offset
fun nextLong() = java.lang.Long.parseLong(next())
fun nextLong(offset: Long = 0L) = nextLong() + offset
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")