fun main(args: Array<String>) {
    val s = readLine()!!.toInt()
    var arr = mutableListOf(s)
    var n = next(s)
    while (!arr.contains(n)) {
        arr.add(n)
        n = next(n)
    }
    println(arr.size + 1)
}


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