program main
implicit none

character*3 :: s
character*1 :: r
integer :: curLongest,totalLongest,i
read(*,*) s

r = 'R'

totalLongest = 0
curLongest = 0

do i=1,3
  if(s(i:i).eq.r) then
    ! write(*,*) s(i:i),r
    curLongest = curLongest + 1
  else
    curLongest = 0
  endif
  if(totalLongest.lt.curLongest) then
    totalLongest = curLongest
  endif
enddo

write(*,*) totalLongest
end program