
object Main extends App {

  import scala.io.StdIn._

  val memo = Array.tabulate(100000){_ ⇒ false}
  var s = readLine.trim.toInt
  var count = 1
  while (!memo(s)){
    count += 1
    memo(s) = true
    s = if (s % 2 == 0) s / 2 else 3 * s + 1
  }
  println(count)

  implicit class Extension[T](val value :T) extends AnyVal {
    @inline
    def let[A](@inline func: T ⇒ A): A = func(value)
    @inline
    def also(@inline func: T ⇒ Unit): T = {func(value); value}
  }
}
