fun main(args: Array<String>) {

    val s = readLine()!!.toInt()
    val a = mutableListOf(s)
    val set = mutableSetOf(s)
    var i = 1
    while (true) {
        val ai = a[i - 1]
        a += if (ai % 2 == 0) {
            ai / 2
        } else {
            3 * ai + 1
        }
        if (!set.contains(a[i])) {
            set.add(a[i])
        } else {
            println(i + 1)
            return
        }
        i++
    }

}