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

    read *,s

    a=len_trim(s)
    if(a<=3)then
        if(s(1:1)=="R")then
            if(s(2:2)=="R")then
                if(s(3:3)=="R")then
                    print *,3
                    stop
                end if
                print *,2
                stop
            end if
            print *,1
            stop
        endif
        if(s(1:3)=="SSS")then
            print *,0
        end if
    endif
end program Rainy_Season