solve :: String -> String
solve a
 | a == "SSR" = "1"
 | a == "SRS" = "1"
 | a == "RSS" = "1"
 | a == "RSR" = "1"  
 | a == "SRR" = "2"
 | a == "RRS" = "2"
 | a == "RRR" = "3"
 | otherwise = "0"

main = putStr =<< solve <$> getLine