import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	} main {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	} @SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int ans = a; ans a for(int i=2; a >= i; i=i*2) {
			ans = i;
		} int i=2; int i=2; i 2 a >= i a i i=i*2 i=i*2 i i*2 i 2 {
			ans = i;
		} {
			ans = i;
		} ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int ans = a;
		for(int i=2; a >= i; i=i*2) {
			ans = i;
		}
		System.out.println(ans);
	}
}
