import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = 1;
        while (x*2<=n) {
            x *= 2;
        }
        System.out.println(x);
        sc.close();
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = 1;
        while (x*2<=n) {
            x *= 2;
        }
        System.out.println(x);
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = 1;
        while (x*2<=n) {
            x *= 2;
        }
        System.out.println(x);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = 1;
        while (x*2<=n) {
            x *= 2;
        }
        System.out.println(x);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int x = 1; x 1 while (x*2<=n) {
            x *= 2;
        } x*2<=n x*2 x 2 n {
            x *= 2;
        } x *= 2 x 2 System.out.println(x) System.out.println System.out System System.out x sc.close() sc.close sc 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 x = 1;
        while (x*2<=n) {
            x *= 2;
        }
        System.out.println(x);
        sc.close();
    }
}