import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util import java.util.stream.IntStream; IntStream java.util.stream public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        } int i = 1; int i = 1; i 1 i <= N i N i *= 2 i *= 2 i 2 {
            ans = Math.max(ans, i);
        } {
            ans = Math.max(ans, i);
        } ans = Math.max(ans, i) ans Math.max(ans, i) Math.max Math ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    }
} Main
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int ans = 0;
        for (int i = 1; i <= N; i *= 2) {
            ans = Math.max(ans, i);
        }
        System.out.println(ans);
    }
}
