program rainy_season
  character(3) :: s
  integer j
  integer :: k = 0
  integer :: i = 1
  read *, s
  do
  j = index(s(i:), 'R')
  if(j == 0) exit
  k = k + 1
  i = i + j
  end do
  print *, k
end program