open Printf
open Scanf

let solve s =
  if List.mem s ["RRR"] then 3
  else if List.mem s ["SRR"; "RRS"] then 2
  else if List.mem s ["SSS"] then 0
  else 1

let () =
  scanf "%s " solve |> printf "%d\n"
