import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 }; array { 1, 2, 4, 8, 16, 32, 64, 101 } 1 2 4 8 16 32 64 101 for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		} int i = 0; int i = 0; i 0 i < array.length i array.length array array.length i++ i++ i {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		} {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		} if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			} array[i] > N array[i] array i N {
				System.out.println(array[i - 1]);
				break;
			} System.out.println(array[i - 1]) System.out.println System.out System System.out array[i - 1] array i - 1 i 1 break; String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] array = { 1, 2, 4, 8, 16, 32, 64, 101 };
		for (int i = 0; i < array.length; i++) {
			if (array[i] > N) {
				System.out.println(array[i - 1]);
				break;
			}
		}
	}
}
