#include using namespace std; int main(){ int N; cin >> N; while(N > 0){ if(N%2 == 1){ cout << N << endl; break; } N /= 2; } return 0; }