import Data.List

main :: IO ()
main = do
  s <- getLine
  print $ solve s

-- |
-- >>> solve "RRS"
-- 2
--
-- >>> solve "SSS"
-- 0
--
-- >>> solve "RSR"
-- 1
--
-- prop> solve xs >= 0
--
-- prop> solve xs == solve (reverse xs)
--
-- prop> solve xs <= length (filter (== 'R') xs)
--
solve :: String -> Int
solve = foldr max 0 . map length . filter (\xs -> head xs == 'R') . group
