object Main {
  def main(args: Array[String]): Unit = {
    val weather = scala.io.StdIn.readLine.split( "" )
    var count = 0
    var flag = false
    weather.foreach{ i =>
      if( i == "R" ) {
        if( flag ) count += 1
        else {
          count = 1
          flag = true
        }
      }
      if( i == "S" ) flag = false
    }
    println( count )
  }
}