f :: Int -> Int
f n
  | even n    = n `div` 2
  | otherwise = 3 * n + 1

solve :: [Int] -> Int
solve list
  | next `elem` list = length list + 1
  | otherwise        = solve (list ++ [next])
  where next = f $ last list


main :: IO ()
main = do
  s <- readLn
  print $ solve [s]