program main
    use,intrinsic :: iso_fortran_env
    implicit none
    character(3):: s

    read*, s

    if (s == "RRR") then
        print'(i0)', 3
    else if (s(1:2) == "RR" .or. s(2:3) == "RR") then
        print'(i0)', 2
    else if (s == "SSS") then
        print'(i0)', 0
    else
        print'(i0)', 1
    end if
end program main