module IntSet = Set.Make (struct type t = int let compare = (-) end)
let _ =
  let s = read_int () in
  let rec find i set n =
    if IntSet.mem n set then
      i
    else
      find (i + 1) (IntSet.add n set) @@ if n mod 2 = 0 then n / 2 else 3 * n + 1
  in
    find 1 IntSet.empty s |> Printf.printf "%d\n"