module Main where

consecLength :: Eq a => a -> [a] -> Integer
consecLength a xs = maximum $ f 0 a xs
	where   f :: Eq a => Integer -> a -> [a] -> [Integer]
		f _ _ [] = []
		f n a (x:xs)
			| a == x = n + 1 : (f (n + 1) a xs)
			| otherwise = 0 : (f 0 a xs)

main :: IO ()
main = getLine >>= putStrLn . show . consecLength 'R'