open Batteries
open Printf
let () =
  let n = Scanf.scanf "%d " (fun a -> a) in

  let l = [1;2;4;8;16;32;64] in
  let ans = 
    List.filter (fun x -> x <= n) l |>
    List.max
  in

  Printf.printf "%d\n" ans
