#include #include int n; std::vector Sn; int count; int main(){ std::cin >> n; for(int i = 1;i <= n;i++){ if( (i&n) == i ){ Sn.push_back(i); count++; } } std::cout << Sn.at((count-1)/2) << std::endl; }