#include <iostream>

using namespace std;

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