program rainy_season
character(3) :: s
read *, s
if(s == "RRS" .or. s == "SRR")then
print *, 2
else if(s == "RRR")then
print *, 3
else if(s == "SSR" .or. s == "SRS" .or. s == "RSS" .or. s == "RSR")then
print *, 1
else
print *, 0
end if
end program 