#define _USE_MATH_DEFINES #include using namespace std; int calc(int x) { if (x == 1) { return 0; } if (x & 1) { return calc(x + 1) + 1; } else { return calc(x / 2) + 1; } } signed main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; cout << calc(n) << endl; return 0; }