fun main(args: Array<String>) {
    val s = readLine()!!

    //val s = "RSR"

    var answer = 0

    val sArray = s.toCharArray()

    sArray.forEachIndexed() { index, tenki ->
        if (tenki == 'R') {
            if (index > 0 && sArray[index - 1] != 'R') answer = 0
            answer++
        }
    }

    println("$answer")
}
