#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
	while(1){
        int n,i;
        cin>>n;
        if(n==0)break;
        for(i=0;n!=1;i++){
            if(n%2==0)n/=2;
            else if(n%2==1)n=n*3+1;
            //cout<<n<<endl;
        }
        cout<<i<<endl;


	}
	return 0;
}