import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int two[] = {1,2,4,8,16,32,64};
int max = 0;
for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
}


System.out.println(two[max]);

} 
} import java.util.*; util.* java class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int two[] = {1,2,4,8,16,32,64};
int max = 0;
for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
}


System.out.println(two[max]);

} 
} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int two[] = {1,2,4,8,16,32,64};
int max = 0;
for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
}


System.out.println(two[max]);

} main {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int two[] = {1,2,4,8,16,32,64};
int max = 0;
for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
}


System.out.println(two[max]);

} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int two[] = {1,2,4,8,16,32,64}; two {1,2,4,8,16,32,64} 1 2 4 8 16 32 64 int max = 0; max 0 for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
} int i = 0; int i = 0; i 0 i<7 i 7 i++ i++ i {
if(two[i] > N) break;
max = i;
} {
if(two[i] > N) break;
max = i;
} if(two[i] > N) break; two[i] > N two[i] two i N break; max = i max i System.out.println(two[max]) System.out.println System.out System System.out two[max] two max String[] args args
import java.util.*;

class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int two[] = {1,2,4,8,16,32,64};
int max = 0;
for(int i = 0;i<7;i++){
if(two[i] > N) break;
max = i;
}


System.out.println(two[max]);

} 
}