import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
}
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; import static java.lang.Math.*; import static java.lang.Math.*; import static java.lang.Math.*; public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
}
} Main public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
} main {
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
} Scanner sc = new Scanner(in); sc new Scanner(in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans=0; ans 0 int temp=0; temp 0 for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    } int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    } {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    } if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        } temp<=Integer.numberOfTrailingZeros(i) temp Integer.numberOfTrailingZeros(i) Integer.numberOfTrailingZeros Integer i {
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        } ans=i ans i temp=Integer.numberOfTrailingZeros(i) temp Integer.numberOfTrailingZeros(i) Integer.numberOfTrailingZeros Integer i out.println(ans) out.println out ans String[] args args public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
}
} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
}
} Main
import java.util.*;
import static java.lang.System.*;
import static java.lang.Math.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(in);
    int n = Integer.parseInt(sc.next());
    int ans=0;
    int temp=0;
    for (int i = 1; i <= n; i++) {
        if(temp<=Integer.numberOfTrailingZeros(i)){
        ans=i;
        temp=Integer.numberOfTrailingZeros(i);
        }
    }
    out.println(ans);
}
}