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

public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	} main {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int times = 0; times 0 int count = 0; count 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int test = n; test n int i = 1; i 1 int counter = 0; counter 0 while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		} n > 0 n 0 {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		} if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} n % 2 == 0 n % 2 n 2 0 {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} while (test % 2 == 0) {
					test /= 2;
					times++;
				} test % 2 == 0 test % 2 test 2 0 {
					test /= 2;
					times++;
				} test /= 2 test 2 times++ times if(count < times) {
					count = times;
				} count < times count times {
					count = times;
				} count = times count times times=0 times 0 n-- n test = n test n while(counter < count)
		{
			i= i*2;
			counter++;
		} counter < count counter count {
			i= i*2;
			counter++;
		} i= i*2 i i*2 i 2 counter++ counter System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	}
} public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	}
} Main
import java.io.*;
import java.util.*;

public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int times = 0;
		int count = 0;
		int n = sc.nextInt();
		int test = n;
		int i = 1;
		int counter = 0;
		while (n > 0) {
			if (n % 2 == 0) {

				while (test % 2 == 0) {
					test /= 2;
					times++;
				}
				if(count < times) {
					count = times;
				}
				times=0;
			} 
			n--;
			test = n;
		}
		while(counter < count)
		{
			i= i*2;
			counter++;
		}
		System.out.println(i);

	}
}