program a175

implicit none
character(len=3) :: a

read *, a

if(a == 'SSS') then
 print *, 0
else if(a == 'RRS') then
 print *, 2
else if(a == 'SRR') then
 print *, 2
else if(a == 'RRR') then
 print *, 3
else
 print *, 1
end if

end program a175