import java.util.*;
public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	}
}	
	
 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 ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	}
} Main public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	} main {
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ni = 2; ni 2 int max = 0; max 0 if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	} N == 1 N 1 {
		System.out.println(1);
	} System.out.println(1) System.out.println System.out System System.out 1 {
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	} while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	} true {
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	} if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		} ni <= N ni N {
			max = ni;
		} max = ni max ni {
			System.out.println(max);
			break;
		} System.out.println(max) System.out.println System.out System System.out max break; ni *= 2 ni 2 String[] args args public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	}
} public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N = sc.nextInt();
	int ni = 2;
	int max = 0;
	if(N == 1){
		System.out.println(1);
	}else{
	while(true){
		if(ni <= N){
			max = ni;
		}else{
			System.out.println(max);
			break;
		}
		ni *= 2;
	}
	}
	}
}	
	

