#include <iostream>
using namespace std;

int main(){
	int a, count;
	while(1){
		count = 0;
		cin >> a;
		if(a == 0)
			break;
		while(a != 1){
			if(a%2 == 0){
				a /= 2;
			}else{
				a = a*3+1;
			}
			count++;
		}
		cout << count << endl;
	}
	
	return 0;
}