f c n | n <= iterate (*2) 1 !! c = c | otherwise = f (c+1) n main = do n <- read <$> getLine print $ f 0 n