open Batteries

let read_two () = Scanf.sscanf (read_line ()) "%d %d" (fun a b -> (a, b))

let read_three () =
  Scanf.sscanf (read_line ()) "%d %d %d" (fun a b c -> (a, b, c))

let read_four () =
  Scanf.sscanf (read_line ()) "%d %d %d" (fun a b c d -> (a, b, c, d))

let read_list () =
  read_line () |> String.split_on_char ' '
  |> List.map (fun s -> int_of_string s)

(* a**x *)
let pow a x =
  let rec aux acc = function 0 -> acc | n -> aux (acc * a) (n - 1) in
  aux 1 x

let rec pow2 n = if n mod 2 = 0 then 1 + pow2 (n / 2) else 0

let rec f n = if n mod 2 = 0 then n / 2 else (3 * n) + 1

module IntSet = Set.Make (struct
  let compare = Pervasives.compare

  type t = int
end)

let () =
  let n = read_int () |> ref in
  let ans = ref 1 and s = ref IntSet.empty in
  while IntSet.exists (fun x -> x = !n) !s |> not do
    s := IntSet.add !n !s;
    n := f !n;
    ans := !ans + 1
  done;
  print_int !ans;
  print_newline ()
