import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 }; num new Integer[] { 2, 4, 8, 16, 32, 64 } Arrays.sort(num, Collections.reverseOrder()) Arrays.sort Arrays num Collections.reverseOrder() Collections.reverseOrder Collections int result = 1; result 1 for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        } int i = 0; int i = 0; i 0 i < num.length i num.length num num.length i++ i++ i {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        } {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        } if (num[i] <= n) {
                result = num[i];
                break;
            } num[i] <= n num[i] num i n {
                result = num[i];
                break;
            } result = num[i] result num[i] num i break; System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        Integer[] num = new Integer[] { 2, 4, 8, 16, 32, 64 };
        Arrays.sort(num, Collections.reverseOrder());
        int result = 1;
        for (int i = 0; i < num.length; i++) {
            if (num[i] <= n) {
                result = num[i];
                break;
            }
        }

        // 出力
        System.out.println(result);
    }
}
