object Main extends App{
  import scala.io.StdIn.readInt
  
  val m = readInt

  def f(x:Long):Long ={
  	if(x % 2 == 0)return x/2
    else return 3*x + 1
  }
  
  def g(acc:Long,x:Long):Long =
  	x match{
      case 4 => acc + 3
      case _ => g(acc + 1,f(x))
  }
  
  println(g(1,m).toString)
}
