
import java.util.*;
import java.lang.*;


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

        int N = sc.nextInt();
        int maxD = 1;


        while (maxD <= N) {
            maxD *= 2;
        }

        System.out.println(maxD/2);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int maxD = 1;


        while (maxD <= N) {
            maxD *= 2;
        }

        System.out.println(maxD/2);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int maxD = 1;


        while (maxD <= N) {
            maxD *= 2;
        }

        System.out.println(maxD/2);
    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int maxD = 1;


        while (maxD <= N) {
            maxD *= 2;
        }

        System.out.println(maxD/2);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int maxD = 1; maxD 1 while (maxD <= N) {
            maxD *= 2;
        } maxD <= N maxD N {
            maxD *= 2;
        } maxD *= 2 maxD 2 System.out.println(maxD/2) System.out.println System.out System System.out maxD/2 maxD 2 String[] args args

import java.util.*;
import java.lang.*;


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

        int N = sc.nextInt();
        int maxD = 1;


        while (maxD <= N) {
            maxD *= 2;
        }

        System.out.println(maxD/2);
    }
}