program main
  implicit none
  
  integer :: i, s
  
  read(*,*)s
  if ((s == 4).or.(s == 2)) then
    write(*,*)4
    stop
  endif
  if (s == 1) then
    write(*,*)4
    stop
  endif
  
  do i = 2, 1000000
    if (mod(s,2) == 0) then
      s = s /2
    else
      s = 3*s + 1
    end if
    
    if (s == 4) then
      exit
    endif
  end do
  
  write(*,*)i + 3
end program main