#include<bits/stdc++.h> using namespace std; int main(){ int n,k=0; cin>>n; for(int i=1;i<=n;i+i){ k=i; } cout<<k; return 0; }