let s = read_int ()
let f n = if n mod 2 = 0 then n / 2 else 3 * n + 1
let cs, p = Array.make 1000001 0, ref s
let _ = cs.(s) <- 1; for i = 2 to 1000000 do p := f !p; if cs.(!p) = 0 then cs.(!p) <- 1 else (Printf.printf "%d\n" i; exit 0) done