object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val s = List.fill(n)(sc.next())

  val cs = "MARCH".map(c => s.count(_.head == c).toLong)
  var ans = 0L
  for {
    i <- 0 until 5
    j <- i+1 until 5
    k <- j+1 until 5
  } {
    ans += cs(i) * cs(j) * cs(k)
  }
  println(ans)
}
