(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let ans = 
        Str.split (Str.regexp "S") (read_line ())
        |> List.map (fun str -> String.length str)
        |> List.max

let () = Printf.printf "%d" ans
