import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	}


}


 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	}


} Main public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	} main {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	} Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int N = reader.nextInt(); N reader.nextInt() reader.nextInt reader int ans = 1; ans 1 while (N / 2 > 0) {
			ans*=2;
			N/=2;
		} N / 2 > 0 N / 2 N 2 0 {
			ans*=2;
			N/=2;
		} ans*=2 ans 2 N/=2 N 2 System.out.println(ans) System.out.println System.out System System.out ans reader.close() reader.close reader String[] args args public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	}


} public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	}


} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner reader = new Scanner(System.in);
		int N = reader.nextInt();
		int ans = 1;
		while (N / 2 > 0) {
			ans*=2;
			N/=2;
		}
		System.out.println(ans);


		reader.close();
	}


}



