import java.util.*;
import java.lang.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    }
} import java.util.*; util.* java import java.lang.*; lang.* java public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    } main {
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int counter = 0; counter 0 double x = Math.log(a) / Math.log(2); x Math.log(a) / Math.log(2) Math.log(a) Math.log Math a Math.log(2) Math.log Math 2 int num = (int)x; num (int)x System.out.print((int)Math.pow(2, num)) System.out.print System.out System System.out (int)Math.pow(2, num) Math.pow Math 2 num String[] args args public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    }
} public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    }
} Main
import java.util.*;
import java.lang.*;
 
public class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int a = scan.nextInt();
      	int counter = 0;
      	
      	double x = Math.log(a) / Math.log(2);
      	int num = (int)x;
      
      	System.out.print((int)Math.pow(2, num));
      	
    }
}