import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    }
} Main public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(input.readLine()); n Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input int start = 1; start 1 while (start * 2 <= n){
                start *= 2;
        } start * 2 <= n start * 2 start 2 n {
                start *= 2;
        } start *= 2 start 2 System.out.println(start) System.out.println System.out System System.out start String[] args args public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    }
} public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args)throws Exception {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(input.readLine());

        int start = 1;
        while (start * 2 <= n){
                start *= 2;
        }

        System.out.println(start);
    }
}
