program Rainy_Season
    implicit none
    character(len=3) s
    integer a

    read *,s

    a=len_trim(s)
    if(a<=3)then
        if(s(1:3)=="RRR")then
            print *,3
        elseif(s(1:2)=="RR" .or. s(2:3)=="RR")then
            print *,2
        elseif(s(1:1)=="R" .or. s(2:2)=="R" .or. s(3:3)=="R")then
            print *,1
        else
            print *,0
        end if
    endif
end program Rainy_Season