object Main extends App {
  val in = scala.io.Source.stdin.getLines.toSeq
  val S = in.head.toInt
  val table = (0 to 100000).map(_ => false).toArray
  
  var n = S
  var i = 1
  do {
    table(n) = true
    n = if(n % 2 == 0) n/2 else 3*n+1
    i += 1
  } while(!table(n))
  
  println(i)
}
