let () =
  let s = read_line () in
  print_endline @@
  string_of_int @@
  match s with
  | "SSS" -> 0
  | "SSR" -> 1
  | "SRS" -> 1
  | "SRR" -> 2
  | "RSS" -> 1
  | "RSR" -> 1
  | "RRS" -> 2
  | "RRR" -> 3

