import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	}
} 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[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] pow2 = {1,2,4,8,16,32,64}; pow2 {1,2,4,8,16,32,64} 1 2 4 8 16 32 64 for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		} int i = 6; int i = 6; i 6 i >= 0 i 0 i-- i-- i {
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		} {
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		} if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			} N >= pow2[i] N pow2[i] pow2 i {
				System.out.println(pow2[i]);
				break;
			} System.out.println(pow2[i]) System.out.println System.out System System.out pow2[i] pow2 i break; String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] pow2 = {1,2,4,8,16,32,64};
		for(int i = 6; i >= 0; i--){
			if(N >= pow2[i]){
				System.out.println(pow2[i]);
				break;
			}
		}
	}
}