#include <iostream>
using namespace std;

int main(){
    for(;;){
        int n;
        if(cin >> n){
            if(n == 0){
                break;
            }
            if(n == 1){
                cout << "0" << endl;
            }else if(n == 2){
                cout << "1" << endl;
            }else if(n == 4){
                cout << "2" << endl;
            }else if(n == 8){
                cout << "3" << endl;
            }
            int l = 3;
            while(n != 8){
                if(n % 2 == 0){
                    n /= 2;
                    l++;
                    if(n == 8){
                        cout << l << endl;
                    }
                }else{
                    n = 3 * n + 1;
                    l++;
                    if(n == 8){
                        cout << l << endl;
                    }
                }
            }
        }else{
            break;
        }
    }
    return 0;
}