import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    } main {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan if (n == 1) {
            System.out.println(1);
            return;
        } n == 1 n 1 {
            System.out.println(1);
            return;
        } System.out.println(1) System.out.println System.out System System.out 1 return; int answer = 0; answer 0 while (n!=1) {
            answer += 1;
            n /= 2;
        } n!=1 n 1 {
            answer += 1;
            n /= 2;
        } answer += 1 answer 1 n /= 2 n 2 System.out.println((int) Math.pow(2,answer)) System.out.println System.out System System.out (int) Math.pow(2,answer) Math.pow Math 2 answer String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        if (n == 1) {
            System.out.println(1);
            return;
        }
        int answer = 0;
        while (n!=1) {
            answer += 1;
            n /= 2;
        }
        System.out.println((int) Math.pow(2,answer));
    }
}
