fun main(args: Array<String>) = println(run {
    var s = readLine()!!.toInt()

    val exist = mutableSetOf<Int>()
    exist.add(s)
    repeat(1000000) {
        if(s%2==0) s/=2 else s=3*s+1
        if(s in exist) return@run it+2
        exist.add(s)
    }
})
