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

    val ans = when (s) {
        "RSS", "SRS", "SSR", "RSR" -> 1
        "RRS", "SRR" -> 2
        "RRR" -> 3
        else -> 0
    }
    println(ans)
}

// read
fun readString() = readLine()!!