#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

const int sz = 35;

int main(){
    ll n;
    cin >> n;
    ll ans = 1 , now = 1;
    while(n > 0){
        if(n & 1){
            ans = now;
        }
        now *= 2;
        n >>= 1;
    }
    cout << ans << endl;
    return 0;
}