import java.util.Scanner;

public class Main {

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

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

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

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

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int i = 0;
		for(i = 1; i <= n; i = i * 2) {
		}
		i = i / 2;
		System.out.println(i);
	}
}