import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    }

} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    }

} Main public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    } main {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    } Scanner scanner=new Scanner(System.in); scanner new Scanner(System.in) int n =scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int pow=1; pow 1 while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	} true {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	} if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		} n>=pow*2 n pow*2 pow 2 {
    			pow*=2;
    		} pow*=2 pow 2 {
    			break;
    		} break; System.out.println(pow) System.out.println System.out System System.out pow scanner.close() scanner.close scanner String[] args args public class Main {
    public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    }

} public class Main {
    public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    }

} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

    	Scanner scanner=new Scanner(System.in);

    	int n =scanner.nextInt();

    	int pow=1;


    	while(true) {

    		if(n>=pow*2) {
    			pow*=2;
    		}else {
    			break;
    		}

    	}


    	System.out.println(pow);

    	scanner.close();


    }

}