object Main extends App {
  @scala.annotation.tailrec
  def loop(s: Int, count: Int): Int = s match {
    case 4 => count + 3
    case n if n % 2 == 0 => loop(n / 2, count + 1)
    case n => loop(3 * n + 1, count + 1)
  }
  val sc = new java.util.Scanner(System.in)
  val s = sc.nextInt()
  println(loop(s, count = 1))
}
