#include <iostream>

using namespace std;

int main(){

	int n;
	int ans;

	while(1){
		ans = 0;
		cin >> n;
		if(n == 0) break;

		while(1){
			if(n == 1) break;

			if(n % 2 == 1){
				n = n * 3 + 1;
				ans++;
			}else if(n % 2 == 0){
				n = n / 2;
				ans++;
			}
		}

		cout << ans << endl;
	}
	return 0;
}