object Main extends App {
  val input = io.StdIn.readLine()
  val score = input match {
    case "RRR" => 3
    case "RRS" => 2
    case "RSR" => 1
    case "RSS" => 1
    case "SRR" => 2
    case "SRS" => 1
    case "SSR" => 1
    case "SSS" => 0
  }
  println(score)
}