#include <iostream>
using namespace std;
int main() {
int N, counter=0;
cin >> N;
while(N!=1){
counter++;
if(N%2==0){
N = N/2;
}
else{
N++;
}
}
cout << counter << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgTiwgY291bnRlcj0wOwoJY2luID4+IE47Cgl3aGlsZShOIT0xKXsKCQljb3VudGVyKys7CgkJaWYoTiUyPT0wKXsgCgkJCU4gPSBOLzI7CgkJfSAKCQllbHNlewoJCQlOKys7CgkJfQoJfQkJCgljb3V0IDw8IGNvdW50ZXIgPDwgZW5kbDsKCXJldHVybiAwOwp9