let () = Scanf.scanf "%d" @@ fun n ->
  let n = n lor (n lsr 1) in
  let n = n lor (n lsr 2) in
  let n = n lor (n lsr 4) in
  let n = n lor (n lsr 8) in
  let n = n lor (n lsr 16) in
  Printf.printf "%d\n" @@ (n + 1) lsr 1
