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 = counts
    else
      if (sss(i-1:i-1) == 'S' ) then
        counts = 1
      else
        counts = counts + 1
      endif   
    endif
  enddo
  write(*,*) counts
end program main