import java.util.*;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int ans = 0;
      	
      	for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        }
      	
      	System.out.println(ans);
    }
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int ans = 0;
      	
      	for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        }
      	
      	System.out.println(ans);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int ans = 0;
      	
      	for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        }
      	
      	System.out.println(ans);
    } main {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int ans = 0;
      	
      	for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        }
      	
      	System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        } {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        } if (n < (int)Math.round(Math.pow(2, i))) break; n < (int)Math.round(Math.pow(2, i)) n (int)Math.round(Math.pow(2, i)) Math.round Math Math.pow(2, i) Math.pow Math 2 i break; ans = (int)Math.round(Math.pow(2, i)) ans (int)Math.round(Math.pow(2, i)) Math.round Math Math.pow(2, i) Math.pow Math 2 i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int ans = 0;
      	
      	for (int i = 0; i < n; i++) {
        	if (n < (int)Math.round(Math.pow(2, i))) break;
          	ans = (int)Math.round(Math.pow(2, i));
        }
      	
      	System.out.println(ans);
    }
}