#include "bits/stdc++.h" using namespace std; int main() { int N, ans = 0; cin >> N; while(N!=1) { if(N & 1) { N++; ans++; } N /= 2; ans++; } cout << ans << '\n'; return 0; }