main :: IO ()
main = do
  n <- readLn :: IO Int
  print $ fst $ maximum $ map (\x -> (x, f x 0)) $ filter even [1..n]

f :: Int -> Int -> Int
f n i
  |odd $ n `div` 2 = i+1
  |otherwise = f (n `div` 2) (i+1)

