module S = Set.Make(struct type t = int let compare = (-) end)
let c x = if x mod 2 = 0 then x / 2 else 3 * x + 1
let rec solve i m x =
  if S.mem x m then i
  else solve (i+1) (S.add x m) (c x)
let _ = Scanf.scanf "%d" (solve 1 S.empty) |> Printf.printf "%d\n"