import scala.math._

object Main {
  val sc = new java.util.Scanner(System.in)
  def calc(n: Int): Int = n match {
    case 1 => 0
    case m if m % 2 == 0 => calc(m/2) + 1
    case m => calc(m*3 + 1) + 1
  }
  def main(args: Array[String]) {
    while(true) {
      val n = sc.nextInt()
      if(n == 0) return

      println(calc(n))
    }
  }
}