import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int power = 1;
        while ((power * 2) <= n) {
            power *= 2;
        }
        System.out.println(power);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int power = 1;
        while ((power * 2) <= n) {
            power *= 2;
        }
        System.out.println(power);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int power = 1;
        while ((power * 2) <= n) {
            power *= 2;
        }
        System.out.println(power);
    } main {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int power = 1;
        while ((power * 2) <= n) {
            power *= 2;
        }
        System.out.println(power);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int power = 1; power 1 while ((power * 2) <= n) {
            power *= 2;
        } (power * 2) <= n (power * 2) power 2 n {
            power *= 2;
        } power *= 2 power 2 System.out.println(power) System.out.println System.out System System.out power String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());

        int power = 1;
        while ((power * 2) <= n) {
            power *= 2;
        }
        System.out.println(power);
    }
}
