import kotlin.math.max

fun main() {
    val s = nextString()
    val ans = solve(s)
    println(ans)
}


//A,C,G,T
fun solve(s: String): Int {
    val rainy = 'R'
    
    if(s == "SRS") return 1

    return max(s.takeWhile { it == rainy }.length, s.takeLastWhile { it == rainy }.length)
}

fun nextInt(): Int {
    return readLine()!!.toInt()
}

fun nextIntList(): List<Int> {
    return readLine()!!.split(" ").map { it.toInt() }
}

fun nextString(): String {
    return readLine()!!
}