import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    }

} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    } main {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    } int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int ans = 0; ans 0 int max = -1; max -1 1 for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        } int i = 1; int i = 1; i 1 i <= N i N i++ i++ i {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        } {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        } if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            } Integer.numberOfTrailingZeros(i) > max Integer.numberOfTrailingZeros(i) Integer.numberOfTrailingZeros Integer i max {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            } max = Integer.numberOfTrailingZeros(i) max Integer.numberOfTrailingZeros(i) Integer.numberOfTrailingZeros Integer i ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    }

} public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    }

} Main
import java.util.Scanner;

public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int ans = 0;
        int max = -1;
        for (int i = 1; i <= N; i++) {
            if (Integer.numberOfTrailingZeros(i) > max) {
                max = Integer.numberOfTrailingZeros(i);
                ans = i;
            }
        }
        System.out.println(ans);
    }

}
