fun main(arr:Array<String>) {
    val s = readLine()!!.toInt()
    val numlist = mutableSetOf<Int>()
    var current = s
    var idx = 1
    while (!numlist.contains(current)) {
        numlist.add(current)
        if(current % 2 == 0) {
            current /= 2
        } else {
            current = current * 3 + 1
        }
        idx ++
    }
    println(idx)
}