import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	}

} 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 i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	}

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

		int i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

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

		int i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int i=0; i 0 while(N >= Math.pow(2, i)) {
			i++;
		} N >= Math.pow(2, i) N Math.pow(2, i) Math.pow Math 2 i {
			i++;
		} i++ i System.out.println((int)Math.pow(2, i-1)) System.out.println System.out System System.out (int)Math.pow(2, i-1) Math.pow Math 2 i-1 i 1 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	}

} 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 i=0;
		while(N >= Math.pow(2, i)) {
			i++;
		}
		System.out.println((int)Math.pow(2, i-1));

	}

}
