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());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 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 = Integer.parseInt(sc.next());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	}

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

		int n = Integer.parseInt(sc.next());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	} main {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	} 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 int multiple = 2; multiple 2 if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		} n < 2 n 2 {
			System.out.println(1);
		} System.out.println(1) System.out.println System.out System System.out 1 {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		} while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			} multiple <= n multiple n {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			} if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				} multiple * 2 > n multiple * 2 multiple 2 n {
					System.out.println(multiple);
					break;
				} System.out.println(multiple) System.out.println System.out System System.out multiple break; {
					multiple *= 2;
				} multiple *= 2 multiple 2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = Integer.parseInt(sc.next());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	}

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

		int n = Integer.parseInt(sc.next());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	}

} 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());

		int multiple = 2;
		if (n < 2) {
			System.out.println(1);
		} else {
			while (multiple <= n) {
				if (multiple * 2 > n) {
					System.out.println(multiple);
					break;
				} else {
					multiple *= 2;
				}
			}
		}

	}

}
