object Main extends App {
	val s = scala.io.StdIn.readInt

	val a = new Array[Int](1000000)

	a(0) = s
	for(i<-1 until 1000000){
		a(i) = test(a(i-1))
	}

	println(a.indexOf(4) + 4)

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

}
