import java.util.*

fun main() {
    val sc = Scanner(System.`in`)
    val s = sc.next()
    val result = calc(s)
    println(result)
}

fun calc(s: String): Int {
    var cnt = 0
    var maxLen = 0
    s.forEach {
        if(it == 'R') {
            cnt++
        } else {
            if(maxLen < cnt) { maxLen = cnt }
            cnt = 0
        }
    }
    return if(maxLen < cnt) cnt else maxLen
}
