import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

readInt :: IO Int
readInt = fst . fromJust . C.readInt <$> C.getLine

main :: IO ()
main = do
  n <- readInt
  print . f $ n

f :: Int -> Int
f n = head . filter (<= n) $ [2^i | i<-[6,5 .. 0]]