import java.util.Scanner

object Main{
  val sc = new Scanner(System.in)
  def main(args :Array[String]):Unit ={
    val s = sc.nextInt

    val result = s match{
      case 1 => 4
      case 2 => 4
      case 4 => 4
      case n => loop((s, 1))._2 + 1
    }

    println(result)
  }

  def loop(tuple : (Int, Int) ):(Int, Int) = {
    tuple._1 match {
      case  1 => tuple
      case _  => loop(op(tuple._1) , tuple._2 + 1)
    }
  }
  def op(n: Int): Int = if(n % 2 == 0 ) n / 2 else 3 * n + 1

}