import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		}
	}
} Main public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		}
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		}
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		} catch (Exception e) {
			System.exit(0);
		} Exception e {
			System.exit(0);
		} System.exit(0) System.exit System 0 {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		} String str = br.readLine(); str br.readLine() br.readLine br int N = Integer.parseInt(str); N Integer.parseInt(str) Integer.parseInt Integer str int a = 0; a 0 while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			} true {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			} if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				} N==1 || N==0 N==1 N 1 N==0 N 0 {
					break;
				} break; {
					N = N/2;
					a++;
				} N = N/2 N N/2 N 2 a++ a System.out.println((int)Math.pow(2, a)) System.out.println System.out System System.out (int)Math.pow(2, a) Math.pow Math 2 a String[] args args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			String str = br.readLine();
			int N = Integer.parseInt(str);
			int a = 0;
			while(true) {
				if(N==1 || N==0) {
					break;
				}else {
					N = N/2;
					a++;
				}
			}

			System.out.println((int)Math.pow(2, a));

		}catch (Exception e) {
			System.exit(0);
		}
	}
}
