
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.close() sc.close sc int[]a = new int[7]; a new int[7] 7 a[0] = 1 a[0] a 0 1 for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		} int i = 1; int i = 1; i 1 i < 7 i 7 i++ i++ i {
			a[i] = a[i - 1] * 2;
		} {
			a[i] = a[i - 1] * 2;
		} a[i] = a[i - 1] * 2 a[i] a i a[i - 1] * 2 a[i - 1] a i - 1 i 1 2 for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		} int i = 0; int i = 0; i 0 i < 7 i 7 i++ i++ i {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		} {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		} if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			} N == a[i] N a[i] a i {
				System.out.println(N);
				System.exit(0);
			} System.out.println(N) System.out.println System.out System System.out N System.exit(0) System.exit System 0 if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			} N < a[i] N a[i] a i {
				System.out.println(a[i - 1]);
				System.exit(0);
			} System.out.println(a[i - 1]) System.out.println System.out System System.out a[i - 1] a i - 1 i 1 System.exit(0) System.exit System 0 System.out.println(a[6]) System.out.println System.out System System.out a[6] a 6 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		sc.close();
		int[]a = new int[7];
		a[0] = 1;
		for(int i = 1; i < 7; i++) {
			a[i] = a[i - 1] * 2;
		}
		for(int i = 0; i < 7; i++) {
			if(N == a[i]) {
				System.out.println(N);
				System.exit(0);
			}else if(N < a[i]) {
				System.out.println(a[i - 1]);
				System.exit(0);
			}
		}
		System.out.println(a[6]);
	}
}