import java.util.*

fun main(args: Array<String>) {
    val s = readLine()!!.toInt()
    var series = ArrayList<Int>()
    series.add(s)
    while(!series.contains(myFunc(series.get(series.lastIndex)))){
        series.add(myFunc(series.get(series.lastIndex)))
    }
    println(series.lastIndex+2)
}
fun myFunc(n: Int): Int{
    return when(n % 2){
        0 -> n / 2
        else -> 3 * n + 1
    }
}
