import scala.io.StdIn._

object Main extends App {

  val s = readInt()

  def solve() = {
    var set = Set.empty[Int]
    var x = s
    while(!set(x)) {
      set += x
      if(x % 2 == 0) x = x/2
      else x = 3 * x + 1
    }
    set.size + 1
  }

  println(solve())

}

