import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  s <- readLn :: IO Int
  print $collatz [s] 1

collatz l@(x:xs) n
  |elem x xs = n
  |otherwise = if mod x 2==0
    then collatz (div x 2:l) (n+1)
    else collatz (x*3+1:l) (n+1)