program main
    implicit none
    integer :: n,i

    read(*,*)n
    if (n >= 64) then
      write(*,*)64
    else if (n >= 32) then
      write(*,*)32
    else if (n >= 16) then
      write(*,*)16
    else if (n >= 8) then
      write(*,*)8
    else if (n >= 4) then
      write(*,*)4
    else if (n >= 2) then
      write(*,*)2
    else
      write(*,*)1
    end if
end program main