import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int[] answers = {1,2,4,8,16,32,64,125}; answers {1,2,4,8,16,32,64,125} 1 2 4 8 16 32 64 125 while(n >= answers[ans + 1]) {
			ans++;
		} n >= answers[ans + 1] n answers[ans + 1] answers ans + 1 ans 1 {
			ans++;
		} ans++ ans System.out.println(answers[ans]) System.out.println System.out System System.out answers[ans] answers ans String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0;
		int[] answers = {1,2,4,8,16,32,64,125};
		while(n >= answers[ans + 1]) {
			ans++;
		}
		System.out.println(answers[ans]);
	}

}