import java.util.*;
import java.math.*;
public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	}
} import java.util.*; util.* java import java.math.*; math.* java public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	}
} Main public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	} main {
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 while(N !=1){
		N = N >> 1;
		cnt++;
		} N !=1 N 1 {
		N = N >> 1;
		cnt++;
		} N = N >> 1 N N >> 1 N 1 cnt++ cnt System.out.println(N << cnt) System.out.println System.out System System.out N << cnt N cnt String[] args args public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	}
} public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	}
} Main
import java.util.*;
import java.math.*;
public class Main {
	
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int cnt = 0;
		
		while(N !=1){
		N = N >> 1;
		cnt++;
		}
		
		System.out.println(N << cnt);
	}
}