import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int ary[] = {1,2,4,8,16,32,64};
      	int ans = 0;
      	for(int i = 0; i < ary.length; i++)
        {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        }
      
        System.out.println(ans);
      
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int ary[] = {1,2,4,8,16,32,64};
      	int ans = 0;
      	for(int i = 0; i < ary.length; i++)
        {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        }
      
        System.out.println(ans);
      
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int ary[] = {1,2,4,8,16,32,64};
      	int ans = 0;
      	for(int i = 0; i < ary.length; i++)
        {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        }
      
        System.out.println(ans);
      
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int ary[] = {1,2,4,8,16,32,64};
      	int ans = 0;
      	for(int i = 0; i < ary.length; i++)
        {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        }
      
        System.out.println(ans);
      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int ary[] = {1,2,4,8,16,32,64}; ary {1,2,4,8,16,32,64} 1 2 4 8 16 32 64 int ans = 0; ans 0 for(int i = 0; i < ary.length; i++)
        {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        } int i = 0; int i = 0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        } {
          if(ary[i] <= num)
          {
          		ans = ary[i];
          }
        } if(ary[i] <= num)
          {
          		ans = ary[i];
          } ary[i] <= num ary[i] ary i num {
          		ans = ary[i];
          } ans = ary[i] ans ary[i] ary i System.out.println(ans) System.out.println System.out System System.out ans String[] args args
import java.util.*;

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