
import java.io.*;
import java.util.*;


	public class Main {
		public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
		public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		}
} Main public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		} main {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		} int number=0; number 0 int counter=0; counter 0 int previousCounter=0; previousCounter 0 int number1=1; number1 1 Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		} int i=0; int i=0; i 0 i<= x i x i++ i++ i {
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		} {
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		} number=i number i while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			} number%2==0 && number!=0 number%2==0 number%2 number 2 0 number!=0 number 0 {
				number= number/2;
				counter++;
			} number= number/2 number number/2 number 2 counter++ counter if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			} counter>previousCounter counter previousCounter {
				previousCounter=counter;
				number1=i;
			} previousCounter=counter previousCounter counter number1=i number1 i counter=0 counter 0 System.out.print(number1) System.out.print System.out System System.out number1 sc.close() sc.close sc String[] args args public class Main {
		public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		}
} public class Main {
		public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		}
} Main

import java.io.*;
import java.util.*;


	public class Main {
		public static void main(String[] args) {
			int number=0;
			int counter=0;
			int previousCounter=0;
			int number1=1;
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		for( int i=0; i<= x; i++)
		{
			number=i;
			while(number%2==0 && number!=0) 
			{
				number= number/2;
				counter++;
			}
			if(counter>previousCounter)
			{
				previousCounter=counter;
				number1=i;
			}
			counter=0;
			
		}
		System.out.print(number1);
		sc.close();
		}
}