let f n = if n mod 2 = 0 then n/2 else 3 * n + 1
let rec g n lst cont =
  let m = f n in
  if List.mem m lst then cont+1 else g m (n :: lst) (cont+1)
let () =
  Scanf.scanf "%d\n" (fun s -> g s [] 1)
  |> print_int