fun main(arr: Array<String>) {
    println(solve(readLine()!!.toInt()))
}

fun solve(init:Int):Int {
    val dic = mutableMapOf(init to 1)
    var prev = init
    for(i in 2..Int.MAX_VALUE) {
        prev = if(prev % 2 == 0) prev /2 else (prev*3+1)
        dic[prev]?.let { return i }
        dic[prev] = i
    }
    return 0
}