
object Main extends App {
  val sc = new java.util.Scanner(System.in) 
  var s = sc.nextInt()
  var a = Seq[Int]()
  while (!a.contains(s)) {    
    a ++= Seq(s)
    s = calc(s)
  }
  println(a.length + 1)

  def calc(n: Int): Int = if (n % 2 == 0) n / 2 else 3 * n + 1
}