#include using namespace std; typedef pair pii; int main() { cin.tie(0); ios::sync_with_stdio(false); int n, ans = 0; cin >> n; while (n > 1) { ans++; if (n % 2 == 1) n++; else n/=2; } cout << ans << endl; }