import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

import static java.util.Comparator.reverseOrder;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    }
} import java.util.Arrays; Arrays java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util import static java.util.Comparator.reverseOrder; import static java.util.Comparator.reverseOrder; import static java.util.Comparator.reverseOrder; public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] list = new int[]{1,2,4,8,16,32,64,128}; list new int[]{1,2,4,8,16,32,64,128} for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        } int i = 0; int i = 0; i 0 i < 8 i 8 i++ i++ i {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        } {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        } if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            } list[i] > n list[i] list i n {
                System.out.println(list[i-1]);
                return;
            } System.out.println(list[i-1]) System.out.println System.out System System.out list[i-1] list i-1 i 1 return; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    }
} Main
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

import static java.util.Comparator.reverseOrder;


public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] list = new int[]{1,2,4,8,16,32,64,128};
        for (int i = 0; i < 8; i++) {
            if (list[i] > n) {
                System.out.println(list[i-1]);
                return;
            }
        }
    }
}