import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    int[] inputArray;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    }

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.*; util.* java public class Main {

    int[] inputArray;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    }

} Main int[] inputArray; inputArray public static void main(String[] args) throws IOException {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    } run {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int input = sc.nextInt(); input sc.nextInt() sc.nextInt sc int n = 1; n 1 while(true){
if (n > input) {
n/=2;
break;}

n*=2;
} true {
if (n > input) {
n/=2;
break;}

n*=2;
} if (n > input) {
n/=2;
break;} n > input n input {
n/=2;
break;} n/=2 n 2 break; n*=2 n 2 if (input == 1) System.out.println(1);
else System.out.println(n); input == 1 input 1 System.out.println(1) System.out.println System.out System System.out 1 System.out.println(n) System.out.println System.out System System.out n public class Main {

    int[] inputArray;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    }

} public class Main {

    int[] inputArray;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    }

} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    int[] inputArray;

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    void run() {
        Scanner sc = new Scanner(System.in);
        int input = sc.nextInt();
int n = 1;
        while(true){
if (n > input) {
n/=2;
break;}

n*=2;
}

if (input == 1) System.out.println(1);
else System.out.println(n);
    }

}
