main :: IO ()
main = do
  s <- getLine
  solver s

solver :: String -> IO ()
solver s
  = print $ if s !! 1 /= 'S'
      then length $ filter (=='R') s
      else if 'R' `elem` s then 1 else 0

solver' :: String -> IO ()
solver' s
  | s == "SSS" = print 0
  | s == "RSS"
  || s== "RSR"
  || s== "SRS"
  || s== "SSR" = print 1
  | s == "RRS"
  || s== "SRR" = print 2
  | otherwise = print 3