import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	}

} 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();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int result = 1; result 1 for(; result <= N; result *= 2) {
		} ; result <= N result N result *= 2 result *= 2 result 2 {
		} {
		} System.out.println(result/2) System.out.println System.out System System.out result/2 result 2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	}

} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int result = 1;
		for(; result <= N; result *= 2) {
		}
		System.out.println(result/2);
	}

}
