fun main(args : Array<String>) {
    var s = readLine()!!.toLong()
    val nums = mutableSetOf<Long>(s)
    for (n in 2..1000000) {
        s = when(s % 2) {
            0L -> s / 2
            else -> s * 3 + 1
        }
        if (nums.contains(s)){
            println(n)
            break
        } else {
            nums.add(s)
        }
    }
}
