import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Comparator;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.HashSet; HashSet java.util import java.io.PrintWriter; PrintWriter java.io import java.io.OutputStream; OutputStream java.io import java.util.Comparator; Comparator java.util public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    }

} Main // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputval {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " int[] intarray = new int[strarray.length]; intarray new int[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputvalInteger {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " Integer[] intarray = new Integer[strarray.length]; intarray new Integer[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    } main {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    } int n = Integer.parseInt(br.readLine().trim()); n Integer.parseInt(br.readLine().trim()) Integer.parseInt Integer br.readLine().trim() br.readLine().trim br.readLine() br.readLine br for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        } int i=n; int i=n; i n i>0 i 0 i-- i-- i {
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        } {
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        } int tmp = i; tmp i while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            } tmp> 0 tmp 0 {
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            } if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                } tmp == 1 tmp 1 {
                    System.out.println(i);
                    return;
                } System.out.println(i) System.out.println System.out System System.out i return; if (tmp %2 != 0){
                    break;
                } tmp %2 != 0 tmp %2 tmp 2 0 {
                    break;
                } break; tmp /= 2 tmp 2 String[] args args public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    }

} public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Comparator;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値配列用 integer ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int n = Integer.parseInt(br.readLine().trim());
        for(int i=n; i>0; i--){
            int tmp = i;
            while (tmp> 0){
                if (tmp == 1){
                    System.out.println(i);
                    return;
                }
                else if (tmp %2 != 0){
                    break;
                }
                tmp /= 2;
            }
        }

    }

}

