let () = Scanf.scanf "%s" @@ fun s -> 
  let ans =
    match s with
    | "SSS" -> 0
    | "SSR" -> 1
    | "SRS" -> 1
    | "SRR" -> 2
    | "RSS" -> 1
    | "RSR" -> 1
    | "RRS" -> 2
    | "RRR" -> 3
    | _ -> raise Not_found
  in
  Printf.printf "%d\n" ans