program rainy_season
  implicit none
  character(3) :: s
  integer :: n
  read(*,*) s
  if (s == 'RRR') then
    n = 3
  else if (s == 'SRR' .or. s == 'RRS') then
    n = 2
  else if (s == 'SSS') then
    n = 0
  else
    n = 1
  end if
  write(*,'(i0)') n
end program rainy_season