
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {

    public static void main(String[] args) throws IOException {
        Scanner Input = new Scanner(System.in);
        int N = Input.nextInt();
        if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        }
    }

} import java.io.*; io.* java import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Scanner; Scanner java.util class Main {

    public static void main(String[] args) throws IOException {
        Scanner Input = new Scanner(System.in);
        int N = Input.nextInt();
        if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        }
    }

} Main public static void main(String[] args) throws IOException {
        Scanner Input = new Scanner(System.in);
        int N = Input.nextInt();
        if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        }
    } main {
        Scanner Input = new Scanner(System.in);
        int N = Input.nextInt();
        if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        }
    } Scanner Input = new Scanner(System.in); Input new Scanner(System.in) int N = Input.nextInt(); N Input.nextInt() Input.nextInt Input if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        } N == 1 N 1 {
            System.out.println("1");
        } System.out.println("1") System.out.println System.out System System.out "1" {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        } int X = 1; X 1 while (X <= N) {
            X*=2;
            } X <= N X N {
            X*=2;
            } X*=2 X 2 System.out.println(X/2) System.out.println System.out System System.out X/2 X 2 String[] args args

import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

class Main {

    public static void main(String[] args) throws IOException {
        Scanner Input = new Scanner(System.in);
        int N = Input.nextInt();
        if (N == 1) {
            System.out.println("1");
        } else {
            int X = 1;
            while (X <= N) {
            X*=2;
            }
            System.out.println(X/2);
        }
    }

}
