import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		} int i=N; int i=N; i N 0<i 0 i i-- i-- i {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		} {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		} for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			} int j=0; int j=0; j 0 j<N j N j++ j++ j {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			} {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			} if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				} i == Math.pow(2, j) i Math.pow(2, j) Math.pow Math 2 j {
					System.out.println(i);
					return;
				} System.out.println(i) System.out.println System.out System System.out i return; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		for (int i=N; 0<i; i--) {
			for (int j=0; j<N; j++) {
				if (i == Math.pow(2, j)) {
					System.out.println(i);
					return;
				}
			}
		}
	}
}
