import Control.Monad
import Control.Applicative
import Data.List
import Data.Array

strToInt s = (read :: String -> Int)


main = do

   n <- readLn :: IO Int
   
   let xn =  [1..n]
   print (maxs 1 xn)


count :: Int -> Int
count x = if (x `mod` 2) == 0
        then 1 + (count (x `div` 2))
        else 0
        
maxs :: Int -> [Int] -> Int
maxs x [] = x
maxs x (y:ys) = if (count x) < (count y)
                then maxs y ys
                else maxs x ys