open Hashtbl
let h = create 1000000
let s = read_int ()
let f n = if n mod 2 = 0 then n / 2 else 3 * n + 1
let x, i = ref s, ref 1
let _ = while not @@ mem h !x do add h !x 1; x := f !x; incr i done; Printf.printf "%d\n" !i