fun main(args: Array<String>) {
    val s = readLine()!!.toInt()

    val bucket = Array(1000001) { i -> i * 0 }
    bucket[s] = 1


    var prev = s

    for (i in 1 until bucket.size) {
        if (prev % 2 == 0) {
            if (bucket[prev / 2] == 1) {
                print(i + 1)
                return
            } else {
                bucket[prev / 2] = 1
                prev = prev / 2
            }

        } else {
            if (bucket[3 * prev + 1] == 1) {
                print(i + 1)
                return
            } else {
                bucket[3 * prev + 1] = 1
                prev = 3 * prev + 1
            }
        }
    }
}