import java.util.Scanner;

public class Main
{
    int n;
    int ans = 1;
    
    public static void main(String args[])
    {
	new Main().run();
    }
    
    void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    }

    void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    }

    void out()
    {
	System.out.println(ans);
    }
} import java.util.Scanner; Scanner java.util public class Main
{
    int n;
    int ans = 1;
    
    public static void main(String args[])
    {
	new Main().run();
    }
    
    void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    }

    void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    }

    void out()
    {
	System.out.println(ans);
    }
} Main int n; n int ans = 1; ans 1 public static void main(String args[])
    {
	new Main().run();
    } main {
	new Main().run();
    } new Main().run() new Main().run new Main() String args[] args void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    } run {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    } in() in int mx = 0; mx 0 for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	} int i = 1; int i = 1; i 1 i <= n i n i++ i++ i {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	} {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	} int cnt = 0 cnt 0 m = i; m i while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    } m % 2 == 0 m % 2 m 2 0 {
		cnt++;
		m /= 2;
	    } cnt++ cnt m /= 2 m 2 if(mx < cnt) {
		mx = cnt;
		ans = i;
	    } mx < cnt mx cnt {
		mx = cnt;
		ans = i;
	    } mx = cnt mx cnt ans = i ans i out() out void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    } in {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) n = sc.nextInt() n sc.nextInt() sc.nextInt sc void out()
    {
	System.out.println(ans);
    } out {
	System.out.println(ans);
    } System.out.println(ans) System.out.println System.out System System.out ans public class Main
{
    int n;
    int ans = 1;
    
    public static void main(String args[])
    {
	new Main().run();
    }
    
    void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    }

    void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    }

    void out()
    {
	System.out.println(ans);
    }
} public class Main
{
    int n;
    int ans = 1;
    
    public static void main(String args[])
    {
	new Main().run();
    }
    
    void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    }

    void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    }

    void out()
    {
	System.out.println(ans);
    }
} Main
import java.util.Scanner;

public class Main
{
    int n;
    int ans = 1;
    
    public static void main(String args[])
    {
	new Main().run();
    }
    
    void run()
    {
	in();

	int mx = 0;
	for(int i = 1; i <= n; i++) {
	    int cnt = 0, m = i;
	    
	    while(m % 2 == 0) {
		cnt++;
		m /= 2;
	    }

	    if(mx < cnt) {
		mx = cnt;
		ans = i;
	    }
	}
	
	out();
    }

    void in()
    {
	Scanner sc = new Scanner(System.in);
	n = sc.nextInt();
    }

    void out()
    {
	System.out.println(ans);
    }
}
