import java.util.Scanner;

public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	}

} 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 maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	}

} Main public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	} main {
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan int maxcount=0; maxcount 0 int max=0; max 0 for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		} int i = 1; int i = 1; i 1 i<=N i N i++ i++ i {
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		} {
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		} int shou=i/2; shou i/2 i 2 int amari=i%2; amari i%2 i 2 int dasshu = 0; dasshu 0 maxcount=0 maxcount 0 do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0); dasshu==0 dasshu 0 {
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			} if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				} amari==0&&shou==1 amari==0 amari 0 shou==1 shou 1 {//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				} maxcount+=1 maxcount 1 dasshu=1 dasshu 1 if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				} amari==0&&shou!=1 amari==0 amari 0 shou!=1 shou 1 {//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				} shou = shou/2 shou shou/2 shou 2 amari = amari%2 amari amari%2 amari 2 maxcount+=1 maxcount 1 if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				} amari !=0 amari 0 {//割り切れなくても脱出
					dasshu=1;
					
				} dasshu=1 dasshu 1 if(max<maxcount){
				max = maxcount;
			} max<maxcount max maxcount {
				max = maxcount;
			} max = maxcount max maxcount System.out.println((int)Math.pow(2, max)) System.out.println System.out System System.out (int)Math.pow(2, max) Math.pow Math 2 max String[]args args public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	}

} public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		
		int maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	}

} 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 maxcount=0;
		int max=0;
		
		
		for(int i = 1;i<=N;i++){
			int shou=i/2;
			int amari=i%2;
			int dasshu = 0;
			
			maxcount=0;
			
			do{
				
				
				
				if(amari==0&&shou==1){//割り切れたが最後の2だった
					maxcount+=1;
					dasshu=1;
				}else if(amari==0&&shou!=1){//2で割れた時だけ繰り返す
					
					shou = shou/2;
					amari = amari%2;
					maxcount+=1;
				}else if(amari !=0){//割り切れなくても脱出
					dasshu=1;
					
				}
			
				
			}while(dasshu==0);
			
			if(max<maxcount){
				max = maxcount;
			}
			
			
		}
		
		
		
		System.out.println((int)Math.pow(2, max));
		
		
		
		
		
	}

}
