#include #include #include #include #include int main(int argc, char *argv[]) { int bisket_num = 0; std::cin >> bisket_num; uint32_t result = 0; for (int clap_num = 0; clap_num <= 32; clap_num++) { uint64_t powered_num = std::pow(2, clap_num); if (bisket_num > powered_num) { continue; } if (bisket_num == powered_num) { result = clap_num; break; } if (bisket_num < powered_num) { clap_num--; uint64_t base_num = std::pow(2, clap_num); uint64_t sub = bisket_num - base_num; if (sub % 2 == 0 || sub == 1) { result = clap_num + 1; } else { result = clap_num + 2; } break; } } std::cout << result << std::endl; return 0; }