import java.util.Scanner;

// 11
class Main{
	static int breakNumber(int n) {
		if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		}
		
		return 0;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int ans = 0;
		for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i));
		
		System.out.println((int)Math.pow(2, ans));
	}

} import java.util.Scanner; Scanner java.util class Main{
	static int breakNumber(int n) {
		if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		}
		
		return 0;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int ans = 0;
		for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i));
		
		System.out.println((int)Math.pow(2, ans));
	}

} Main static int breakNumber(int n) {
		if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		}
		
		return 0;
	} breakNumber {
		if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		}
		
		return 0;
	} if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		} n % 2 == 0 n % 2 n 2 0 {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		} int tmp = n; tmp n int count = 0; count 0 while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			} tmp > 0 tmp 0 {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			} if(tmp / 2 == 1) {
					++count;
					break;
				} tmp / 2 == 1 tmp / 2 tmp 2 1 {
					++count;
					break;
				} ++count count break; tmp /= 2 tmp 2 ++count count return count; count return 0; 0 int n n public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int ans = 0;
		for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i));
		
		System.out.println((int)Math.pow(2, ans));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int ans = 0;
		for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i));
		
		System.out.println((int)Math.pow(2, 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 for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i)); int i = 2; int i = 2; i 2 i <= N i N i++ i++ i ans = Math.max(ans, breakNumber(i)); ans = Math.max(ans, breakNumber(i)) ans Math.max(ans, breakNumber(i)) Math.max Math ans breakNumber(i) breakNumber i System.out.println((int)Math.pow(2, ans)) System.out.println System.out System System.out (int)Math.pow(2, ans) Math.pow Math 2 ans String[] args args
import java.util.Scanner;

// 11
class Main{
	static int breakNumber(int n) {
		if (n % 2 == 0) {
			int tmp = n;
			int count = 0;
			while (tmp > 0) {
				if(tmp / 2 == 1) {
					++count;
					break;
				}
				tmp /= 2;
				++count;
			}
			return count;
		}
		
		return 0;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		
		int ans = 0;
		for(int i = 2; i <= N; i++)
			ans = Math.max(ans, breakNumber(i));
		
		System.out.println((int)Math.pow(2, ans));
	}

}
