#include<iostream>
using namespace std;

int main(){
	int n, cnt, x;
	while(cin>>n&&n){
		x=n;
		cnt=0;
		while(x>1){
			if(x%2){
				x+=x*2+1;
			}else{//gusu
				x/=2;
			}
			cnt++;
		}
		cout<<cnt<<endl;
	}
	return 0;
}