object HelloWorld {
  def main(args : Array[String]): Unit = {
    val input = io.StdIn.readLine()
    val score = input match {
      case "RRR" => 0
      case "RRS" => 1
      case "RSR" => 1
      case "RSS" => 2
      case "SRR" => 1
      case "SRS" => 1
      case "SSR" => 1
      case "SSR" => 2
      case "SSS" => 3
    }
    println(score)
  }
}