#include #include #include using ll = std::uint64_t; int main() { ll n; std::cin >> n; ll b = 60; while (true) { ll mask = 1ll << b; if (b & n) break; b--; } std::cout << (1ll << b) << std::endl; return 0; }