let () =
  Scanf.scanf "%1s%1s%1s\n" @@ fun s1 s2 s3 ->
  Printf.printf "%d\n"
    (if s1 = "S" && s2 = "S" && s3 = "S" then 0 
     else if s1 = "R" && s2 = "R" && s3 = "R" then 3
     else if (s1 = "R" && s2 = "R") || (s2 = "R" && s3 = "R") then 2 else 1)