#include using namespace std; int main(int argc, const char * argv[]) { int N; cin >> N; int rst, workingValue; if ((log2(N) - (int)log2(N)) > 0) { rst = (int)log2(N) + 1; rst += ((int)pow(2, rst) - N); cout << rst << endl; return 0; } else { cout << log2(N) << endl; return 0; } return 0; }