object Main extends App {
	val N = scala.io.StdIn.readInt
	
	val cnt = Array(0,0,0,0,0)

	for(i<-0 until N){
		val temp = scala.io.StdIn.readLine.toList

		temp.head match {
			case 'M' => cnt(0) += 1
			case 'A' => cnt(1) += 1
			case 'R' => cnt(2) += 1
			case 'C' => cnt(3) += 1
			case 'H' => cnt(4) += 1
			case _ =>  
		}
	}

	var ans = 0L
	val cntl = cnt.map(_.toLong)

	ans += cntl(0)*cntl(1)*cntl(2)
	ans += cntl(0)*cntl(1)*cntl(3)
	ans += cntl(0)*cntl(1)*cntl(4)
	ans += cntl(0)*cntl(2)*cntl(3)
	ans += cntl(0)*cntl(2)*cntl(4)
	ans += cntl(0)*cntl(3)*cntl(4)
	ans += cntl(1)*cntl(2)*cntl(3)
	ans += cntl(1)*cntl(2)*cntl(4)
	ans += cntl(1)*cntl(3)*cntl(4)
	ans += cntl(2)*cntl(3)*cntl(4)

	println(ans)

}