import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int kai = 1; kai 1 for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        } {
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        } kai = kai * 2 kai kai * 2 kai 2 if(kai > N){
                kai = kai / 2;
                break;
            } kai > N kai N {
                kai = kai / 2;
                break;
            } kai = kai / 2 kai kai / 2 kai 2 break; System.out.println(kai) System.out.println System.out System System.out kai String[] args args public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    }
} public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int kai = 1;
        for(int i = 0; i < N ; i++){
            kai = kai * 2;
            if(kai > N){
                kai = kai / 2;
                break;
            }
        }
        System.out.println(kai);
    }
}