import Prelude main :: IO () main = do n <- read <$> getLine print $ calc n calc :: Int -> Int calc 1 = 0 calc n | mod n 2 == 1 = 1 + calc' (n - 1) | otherwise = calc' n where calc' :: Int -> Int -- n is always even. calc' n = let ms = takeWhile (<= n) $ iterate (* 2) 1 in if last ms == n then length ms - 1 else length ms