main = do
    s <- getLine
    case s of
        "SSS" -> print $ 0
        "RRR" -> print $ 3
        "SSR" -> print $ 1
        "RRS" -> print $ 2
        "SRR" -> print $ 2
        "RSS" -> print $ 1
        "SRS" -> print $ 1
        "RSR" -> print $ 1