program abc39
 implicit none
 character(len=3)::S
 integer::a(3)
 integer::ia,ans
 read(*,*)S
 do ia=1,3
  if(S(ia:ia)=="R")then
   a(ia)=1
  else
   a(ia)=0
  end if
 end do
 if(a(1)==1.and.a(2)==0.and.a(3)==1)then
  ans=1
 else
  ans=sum(a)
 end if
 print'(i0)',ans
end program abc39