#include<iostream>
#include<cstdio>
#include<algorithm>
#include<climits>
#include<string>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<cstring>
#include<stack>
#include<functional>
using namespace std;

int main(){
	int N;
	while(cin>>N,N){
		int i=0;
		for(i=0;N!=1;i++){
			if((N&1)==0) N /= 2;
			else N = N*3+1;
		}
		printf("%d\n",i);
	}
	return 0;
}