import java.util.*;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int[] list = { 1, 2, 4, 8, 16, 32, 64 };
      	
		int size = list.length;
      	int right = size;
      	int left = 0;
      	while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        }
      	System.out.println(list[left]);
    }
} import java.util.*; util.* java class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int[] list = { 1, 2, 4, 8, 16, 32, 64 };
      	
		int size = list.length;
      	int right = size;
      	int left = 0;
      	while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        }
      	System.out.println(list[left]);
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int[] list = { 1, 2, 4, 8, 16, 32, 64 };
      	
		int size = list.length;
      	int right = size;
      	int left = 0;
      	while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        }
      	System.out.println(list[left]);
    } main {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int[] list = { 1, 2, 4, 8, 16, 32, 64 };
      	
		int size = list.length;
      	int right = size;
      	int left = 0;
      	while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        }
      	System.out.println(list[left]);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[] list = { 1, 2, 4, 8, 16, 32, 64 }; list { 1, 2, 4, 8, 16, 32, 64 } 1 2 4 8 16 32 64 int size = list.length; size list.length list list.length int right = size; right size int left = 0; left 0 while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        } left + 1 != right left + 1 left 1 right {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        } if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2; n >= (list[(right + left) / 2]) n (list[(right + left) / 2]) list (right + left) / 2 (right + left) right left 2 left = (right + left) / 2 left (right + left) / 2 (right + left) right left 2 right = (right + left) / 2 right (right + left) / 2 (right + left) right left 2 System.out.println(list[left]) System.out.println System.out System System.out list[left] list left String[] args args
import java.util.*;

class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
      	int n = Integer.parseInt(sc.next());
      	int[] list = { 1, 2, 4, 8, 16, 32, 64 };
      	
		int size = list.length;
      	int right = size;
      	int left = 0;
      	while (left + 1 != right) {
          if (n >= (list[(right + left) / 2])) left = (right + left) / 2;
          else right = (right + left) / 2;
        }
      	System.out.println(list[left]);
    }
}