import Prelude main :: IO () main = do n <- read <$> getLine print $ calc n calc :: Int -> Int calc 1 = 0 calc n = let ms = takeWhile (<= n) $ iterate (* 2) 1 in if last ms == n then length ms - 1 else length ms