import java.util.*

fun main(vararg args: String) {
    val scanner = Scanner(System.`in`)
    val input = scanner.nextInt()

    calc(input, mutableListOf(), 1)
}

fun calc(input: Int, list: MutableList<Int>, count: Int) {
    if (list.contains(input)) {
        println(count)
        return
    }

    list.add(input)
    calc(newValue(input), list, count + 1)
}

fun newValue(input: Int): Int {
    return if (input % 2 == 0) { input / 2 } else { input * 3 + 1}
}