import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				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 = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	} 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 for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		} int i=0; int i=0; i 0 i<10 i 10 i++ i++ i {
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		} {
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		} if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			} Math.pow(2, i) > N Math.pow(2, i) Math.pow Math 2 i N {
				System.out.println((int)Math.pow(2, i-1));
				return;
			} System.out.println((int)Math.pow(2, i-1)) System.out.println System.out System System.out (int)Math.pow(2, i-1) Math.pow Math 2 i-1 i 1 return; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int N = Integer.parseInt(sc.next());
		for (int i=0; i<10; i++){
			if (Math.pow(2, i) > N){
				System.out.println((int)Math.pow(2, i-1));
				return;
			}
		}
	}
}