[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

let collatz s =
    let f n = if n % 2 = 0 then n / 2 else 3 * n + 1
    seq {
        yield s
        yield! Seq.unfold (fun x -> Some (f x, f x)) s
    }

let solve s =
    let mutable memo = Set.empty
    seq {
        for (i, x) in Seq.zip (Seq.initInfinite ((+) 1)) (collatz s) do
            if Set.contains x memo
            then yield i
            else memo <- Set.add x memo
    }
    |> Seq.head

[<EntryPoint>]
let main argv =
    let s = read int
    printfn "%i" (solve s)
    0