import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	}
	
	static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	}
	
	static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int count = 0; count 0 while(N != 1){
			N /= 2;
			count++;
		} N != 1 N 1 {
			N /= 2;
			count++;
		} N /= 2 N 2 count++ count System.out.println(pow(count)) System.out.println System.out System System.out pow(count) pow count String[] args args static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	} pow {
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	} int pow = 1; pow 1 for(int idx = 0; idx < n; idx++)
			pow *= 2; int idx = 0; int idx = 0; idx 0 idx < n idx n idx++ idx++ idx pow *= 2; pow *= 2 pow 2 return pow; pow int n n public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	}
	
	static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	}
	
	static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int count = 0;
		while(N != 1){
			N /= 2;
			count++;
		}
		System.out.println(pow(count));
	}
	
	static int pow(int n){
		int pow = 1;
		for(int idx = 0; idx < n; idx++)
			pow *= 2;
		return pow;
	}
}