
import java.util.*
fun main(args: Array<String>) {
    val reader = Scanner(System.`in`)
    var weatherStr = reader.next()
    var maxLen = 0
    var count = 0

    repeat(weatherStr.length){
        if(weatherStr[it] == 'R'){
            count++
        }
        else {
            if(count > maxLen){
                maxLen = count
            }
            count = 0
        }
    }
    if(count > maxLen){
        maxLen = count
    }
        
    println(maxLen)
}