fun main(arr: Array<String>) {
    val s = readLine()!!.toLong()
    val log = mutableSetOf(s)
    var current = s
    while (true) {
        if(current % 2 == 0L) {
            current /= 2
        } else {
            current = current * 3 + 1
        }
        if(log.contains(current)) {
            println(log.size + 1)
            return
        } else {
            log.add(current)
        }
    }
}