#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
#include <climits>
using namespace std;
#define PLL pair<int, int>
#define ULL unsigned long long
#define LS l,mid,lson
#define RS mid+1,r,rson
#define MEM(a,x) memset(a,x,sizeof(a))
#define gcd(a,b) __gcd(a,b)
int n;
const int N=100010;
int a[N];




int main(){
    cin>>n;
    int k=1;
    while(1){
        if(k*2>n){
            cout<<k<<endl;
            break;
        }
        else k=k*2;
    }
    
    return 0;
}
