let rec makelst lst = if lst = 0 then [] else
    lst :: makelst (lst-1)

let rec waru2 n = if n mod 2 = 0  then 1 + waru2 (n/2) else 0
    
let rec waru2lst2  lst = match lst with
    [] -> 0
  | first :: rest -> let rm  = waru2lst2 rest in  if waru2 first >= rm then first else rm;;

let waru2lst n = let pp = waru2lst2 (makelst n) in if pp = 0 then 1 else pp;;

let main () = Scanf.sscanf (read_line()) "%d" (fun a -> print_int(waru2lst a));;

let _ = main ();;