#include <iostream>

using namespace std;

int main(void){
    int i,j,k,l;
    int data;
    
    while(true){
        cin>>data;
        if(data==0)break;
        
        k=0;
        while(data!=1){
            if(data%2==0){
                data=data/2;
            }
            else{
                data=data*3+1;
            }
            k++;
        }
        cout<<k<<endl;
    }
    return(0);
}