(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let () =
        Scanf.sscanf (read_line ()) "%d" (
                fun n -> 
                        List.range 0 `To 7
                        |> List.map (fun elmnt ->
                                Int.pow 2 elmnt
                        )
                        |> List.filter (fun elmnt ->
                                elmnt <= n
                        )
                        |> List.max
        ) |> Printf.printf "%d\n"
