program main
  implicit none
  character(3) :: sss
  integer :: i, counts
  read(*,*) sss
  
  counts = 0
  do i = 1, 3
    if ( sss(i:i) == 'S' ) then
      counts = 0
    else
      counts = counts + 1
    endif
  enddo
  write(*,*) counts
end program main