main = do
  [s] <- map read . words <$> getLine
  let xs = func s
  print $ length xs + 4
  
func :: Int -> [Int]
func 4 = []
func x 
  | even x = (x `div` 2) : func (x `div` 2)
  | otherwise = (x * 3 + 1) : func (x * 3 + 1)

